Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » SCROLLING WITH ENEMIES
- HumanLight
- Scratcher
100+ posts
SCROLLING WITH ENEMIES
Hi all!
Could someone help me out I have a problem,
I'd love to know how to, have a enemy in a scrolling game that moves with the scrolling backgrounds, but can walk into the section your player is on to chase the player., but you can run away from the enemy whilst scrolling away, without the enemy being in the same screen position. hard to explain but i done it best i could o_o
Could someone help me out I have a problem,
I'd love to know how to, have a enemy in a scrolling game that moves with the scrolling backgrounds, but can walk into the section your player is on to chase the player., but you can run away from the enemy whilst scrolling away, without the enemy being in the same screen position. hard to explain but i done it best i could o_o
- manwithmanykids
- Scratcher
67 posts
SCROLLING WITH ENEMIES
DEpending on how you are doing the chasing, I think you may have to have 2 variables to track the enemy. ENX would be the X location on the screen, and ENRX would be the Relative X Coordinate. Alternately you could track just ENRX, and then when PlayerX-220 > ENRX, then display the enemy. So if this is confusing
- Ricky10f
- Scratcher
23 posts
SCROLLING WITH ENEMIES
when green flag clicked
forever
go to x: (((Scrollx) + (Enemy Position))) y: (Whatever number you want)
end
Put that script on the enemy, and then a basic scrolling script for the player, If you don't know how to do that part, reply to this post and I'll be glad to help. Then If you want to move the enemy, use
change [ enemy position] by (any number)
instead of regular move scripts
Last edited by Ricky10f (Feb. 28, 2014 22:42:52)
- Discussion Forums
- » Help with Scripts
- » SCROLLING WITH ENEMIES