Discuss Scratch

DonutV1
Scratcher
2 posts

X,Y Scrolling: How Do You Make Enemies move in an X and Y scrolling game? Help Plz

I Am making a scrolling game with X and Y scrolling. I gotten the main character you control to move, but I can't Get the enemies to move with the scrolling. Help with the scrolling script would be appreciated.
-Thanks
letrainbleuetrouge
Scratcher
100+ posts

X,Y Scrolling: How Do You Make Enemies move in an X and Y scrolling game? Help Plz

You just have to add the scrolling delta x to the x position of the ennemy (of course, modulo 480).
Eventually the ennemy will disapear outside the screen if he does not “wolk” because he will move with the background.

See the bats in this simple scrolling game: http://scratch.mit.edu/projects/15189004
firedrake969_test
Scratcher
500+ posts

X,Y Scrolling: How Do You Make Enemies move in an X and Y scrolling game? Help Plz

DonutV1 wrote:

I Am making a scrolling game with X and Y scrolling. I gotten the main character you control to move, but I can't Get the enemies to move with the scrolling. Help with the scrolling script would be appreciated.
-Thanks
Hey, it's me

So you want to have a pseudo (fake) x position for the enemies, and add that to the scrollX variable to get it to be in the right place. Same with Y scroll. Here's something like what I mean:

Go to x:((myX) + (scrollX)) y:((myY) + (scrollY))

And instead of doing something like change X by 5, you do the variable with change myX by 5.

Last edited by firedrake969_test (Dec. 13, 2013 22:08:54)


Alt account of Firedrake969.

Rocket II: A black and white bitmap space game!

I seek not fame, but education.

;
DonutV1
Scratcher
2 posts

X,Y Scrolling: How Do You Make Enemies move in an X and Y scrolling game? Help Plz

Thanks everybody that really helped.
TeamRoar
Scratcher
11 posts

X,Y Scrolling: How Do You Make Enemies move in an X and Y scrolling game? Help Plz

Thanks

what should I say. If you want to check out my games you can
StrangeMagic32
Scratcher
1000+ posts

X,Y Scrolling: How Do You Make Enemies move in an X and Y scrolling game? Help Plz

Hey, it's me :D

So you want to have a pseudo (fake) x position for the enemies, and add that to the scrollX variable to get it to be in the right place. Same with Y scroll. Here's something like what I mean:

Go to x:((myX) + (scrollX)) y:((myY) + (scrollY))

And instead of doing something like change X by 5, you do the variable with change myX by 5.

What do you mean by this?
I mean can you explain it more for me maybe


So sorry for the necro, didn't notice

Last edited by StrangeMagic32 (May 9, 2019 22:25:03)


"All right, I've been thinking. When life gives you lemons, don't make lemonade. Make life take the lemons back! GET MAD! I DON'T WANT YOUR * LEMONS! What am I supposed to do with these? Demand to see life's manager! Make life rue the day it thought it could give CAVE JOHNSON lemons! Do you know who I am? I'm the man who's gonna BURN YOUR HOUSE DOWN! With the LEMONS! I'm gonna get my engineers to invent a combustible lemon that burns your house down!"
- Cave Johnson
StrangeMagic32
Scratcher
1000+ posts

X,Y Scrolling: How Do You Make Enemies move in an X and Y scrolling game? Help Plz

nvm
same here…

Last edited by StrangeMagic32 (May 9, 2019 22:25:18)


"All right, I've been thinking. When life gives you lemons, don't make lemonade. Make life take the lemons back! GET MAD! I DON'T WANT YOUR * LEMONS! What am I supposed to do with these? Demand to see life's manager! Make life rue the day it thought it could give CAVE JOHNSON lemons! Do you know who I am? I'm the man who's gonna BURN YOUR HOUSE DOWN! With the LEMONS! I'm gonna get my engineers to invent a combustible lemon that burns your house down!"
- Cave Johnson
gtoal
Scratcher
1000+ posts

X,Y Scrolling: How Do You Make Enemies move in an X and Y scrolling game? Help Plz

has there been some change to the way the forums work lately? I'm seeing a lot of necroposts on old articles that should be buried so far in the past that you don't even see them…

Powered by DjangoBB

Standard | Mobile