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.
Last edited by calebxy (2011-06-29 14:54:15)
Offline
bump
Offline
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.
![]()
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.
Last edited by cheddargirl (2011-06-30 18:55:19)
Offline