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

#1 2011-06-29 14:53:56

calebxy
Scratcher
Registered: 2009-12-31
Posts: 1000+

How do I...?

How do I make it so that, on a side scrolling game, the enemy will be jumping up and down and landing at random points on the screen (along the X position)? I can make it do that normally, but I don't know how to make it's position changes as the scrollX changes.  hmm

Last edited by calebxy (2011-06-29 14:54:15)


I'm making my own Doctor Who series!  big_smile  See the first episode here.
And please join Story Zone!  big_smile

Offline

 

#2 2011-06-29 16:55:47

calebxy
Scratcher
Registered: 2009-12-31
Posts: 1000+

Re: How do I...?

bump


I'm making my own Doctor Who series!  big_smile  See the first episode here.
And please join Story Zone!  big_smile

Offline

 

#3 2011-06-29 17:11:10

cheddargirl
Scratch Team
Registered: 2008-09-15
Posts: 1000+

Re: How do I...?

calebxy wrote:

How do I make it so that, on a side scrolling game, the enemy will be jumping up and down and landing at random points on the screen (along the X position)? I can make it do that normally, but I don't know how to make it's position changes as the scrollX changes.  hmm

Even though the sprite is landing at random points, Scratch still needs some kind of coordinate position to know where to randomly place the sprite. Just have the position change by the same amount as scrollX changes.

For example, let's say that you have the screen change by -10 pixels in the X direction whenever the right arrow key is pressed. So, for the enemy to adjust whenever the right arrow key is pressed, you would remove 10 pixels from the enemy sprite's current position.  smile

Last edited by cheddargirl (2011-06-30 18:55:19)


http://i.imgur.com/8QRYx.png
Everything is better when you add a little cheddar, because when you have cheese your life is at ease  smile

Offline

 

Board footer