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)


That moment when…
1. you accidentally go from one forum to another...   2. you try to help, but get beaten to it...   3. you read a post in all caps...   4. you post on the forums and your post isn't very constructive...   5. you end up not helping...   6. you post something before you're finished... 7. you post and it turns out to be a necropost...   8. you finish writing your post, but by the time you post it, someone else has practically said the same thing...   9: you share a CCE or DTAE before it's done...   10: you share a game before it's done...   11: you accidentally unshare a project you shared just moments before...   12. you accidentally report your own comment...   13. you accidentally reset your cloud highscore... 14. you accidentally delete your own project that you just finished...   15. your topic has existed for 4 years and it turns out to be a duplicate...   16. you finished making your project but there is no wifi to save it...   17. you sign in after a year, but you forgot your password, so you go to recover, but you own a trillion emails...   18.you necropost then 5 weeks later someone replies to your necropost, telling you not to necropost...   19. you click a topic with the intent to reply on it but it gets closed right when you click on it so you're unable to reply...   20. someone says your topic is a duplicate and the last post on that duplicate was posted 6 years ago...   21. you come up with a great suggestion to improve Scratch then it turns out to be a duplicate...   22. you worked super hard on a remix but it dosen't save...   23. you accidentally close your best topic...   24. you get lots of notifications, but they just turn out to be studio messages...   25. you comment on a user's profile but it turned out to be the wrong user...
(do you have any good ones? message me on my profile)
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)


That moment when…
1. you accidentally go from one forum to another...   2. you try to help, but get beaten to it...   3. you read a post in all caps...   4. you post on the forums and your post isn't very constructive...   5. you end up not helping...   6. you post something before you're finished... 7. you post and it turns out to be a necropost...   8. you finish writing your post, but by the time you post it, someone else has practically said the same thing...   9: you share a CCE or DTAE before it's done...   10: you share a game before it's done...   11: you accidentally unshare a project you shared just moments before...   12. you accidentally report your own comment...   13. you accidentally reset your cloud highscore... 14. you accidentally delete your own project that you just finished...   15. your topic has existed for 4 years and it turns out to be a duplicate...   16. you finished making your project but there is no wifi to save it...   17. you sign in after a year, but you forgot your password, so you go to recover, but you own a trillion emails...   18.you necropost then 5 weeks later someone replies to your necropost, telling you not to necropost...   19. you click a topic with the intent to reply on it but it gets closed right when you click on it so you're unable to reply...   20. someone says your topic is a duplicate and the last post on that duplicate was posted 6 years ago...   21. you come up with a great suggestion to improve Scratch then it turns out to be a duplicate...   22. you worked super hard on a remix but it dosen't save...   23. you accidentally close your best topic...   24. you get lots of notifications, but they just turn out to be studio messages...   25. you comment on a user's profile but it turned out to be the wrong user...
(do you have any good ones? message me on my profile)
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