This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2010-12-19 17:57:48

eyedea10
New Scratcher
Registered: 2010-12-15
Posts: 1

Pen block

I am building a motorcycle jumping game.  I allow the user to put in the angle of the ramp, which is then drawn on screen using the pen block.  As the motorcycle travels toward the ramp the level scrolls.  Is there any way to have a finished pen drawing scroll with the scene.

Offline

 

#2 2010-12-23 04:09:27

WeirdF
Scratcher
Registered: 2009-05-31
Posts: 1000+

Re: Pen block

Wow... That's a hard one... I suppose you could continually redraw the line.

But personally I think you're better off having a sprite which is a straight line, and then when the angle is entered, it points in that direction.

Last edited by WeirdF (2010-12-23 10:12:13)


http://i.cr3ation.co.uk/dl/s1/gif/847032b8a331def77529b6a0384db1fe_handfingers.gif

Offline

 

#3 2010-12-23 05:50:05

Thenuclearduck
Scratcher
Registered: 2010-10-17
Posts: 100+

Re: Pen block

I guess you could do something like this...
[blocks]<when green flag clicked>
<forever>
<point in direction( angle
<pen down>
<repeat( 10
<move( 1 )steps>
<end>
<pen up>
<repeat( 10
<move( -1 )steps>
<end>
<end>
<when green flag clicked>
<forever>
<change x by( scrollx
<end>[/blocks]

This would make the sprite continually keep drawing the line, but in the place that scrollx is.
(this may not work very well, and if it dosent, replace the repeats with just 10x the move 1 steps blocks.
Hope I helped!


http://blocks.scratchr.org/API.php?user=Thenuclearduck&amp;action=projects&amp;type=newest&amp;return=text&amp;num=1 is my newest project! It has http://blocks.scratchr.org/API.php?user=Thenuclearduck&amp;action=projects&amp;type=newest&amp;return=views&amp;num=1 views!

Offline

 

#4 2010-12-23 09:30:37

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: Pen block

I'd go with WeirdF's solution of just making a sprite that's a line and having it rotate. Since things drawn with pen are static, you would have to constantly redraw the line, which only sometimes works. (Usually it tends to flash and look bad.)


http://www.blocks.scratchr.org/API.php?action=random&amp;return=image&amp;link1=http://i.imgur.com/OZn2RD3.png&amp;link2=http://i.imgur.com/duzaGTB.png&amp;link3=http://i.imgur.com/CrDGvvZ.png&amp;link4=http://i.imgur.com/POEpQyZ.png&amp;link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

Board footer