Discuss Scratch

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

▼ Humanlight Productions ▼ Horror ● Sci-fi ● Adventure ● Virtual Worlds ● Simulations

Sunrise-Moon
Scratcher
2 posts

SCROLLING WITH ENEMIES

I'd have to take a look at the script you use for scrolling and for the enemy but I might be able to help. Could you post the project?

Last edited by Sunrise-Moon (May 28, 2013 04:29:23)


HumanLight
Scratcher
100+ posts

SCROLLING WITH ENEMIES

Sunrise-Moon wrote:

I'd have to take a look at the script you use for scrolling and for the enemy but I might be able to help. Could you post the project?

Yeah will do once I started making it Thanks

▼ Humanlight Productions ▼ Horror ● Sci-fi ● Adventure ● Virtual Worlds ● Simulations

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


Heres my Pokemon Battle Project

http://scratch.mit.edu/projects/10433760/

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)

Powered by DjangoBB