Pages: 1
Topic closed
Hi, I'm working on a scrolling game in which will have moving platforms. I know how to make the platforms work with the scroller, but one key piece of information that I need is missing. I would like to know how I can get the platforms to move while the player is roaming and not on any of them. I know how to make a platform function vertically (y position). It's horizontally (x-position) that I'm concerned with. For example, when a player walks up to a platform, have said platform following it's path to and from point A and point B, horizontally. I cannot fathom how this can be done while the game is a scroller, being as how you have to set object's and terrain's x position to:
forever set x to [scrollx + 480 * 0] //and add 1 for every terrain, etc.^ with that, things only move according to it, which is why I'm confused.
Offline
The script
forever set x to ((scrollx) + ((480) * (amount)))only works with
when [right arrow v] key pressed change [scrollx v] by (0.8) when [left arrow v] key pressed change [scrollx v] by (-0.8)or similar scripts in the sprite that is "moving". This gives an illusion of movement.
Last edited by 360-International (2012-01-30 15:24:15)
Offline
I understand that. Like I know how scrollers work, but I mean I don't know how I would make a platform move on it's own in game, while also moving with the scroller. ):
***(on its x posistion, that is)
Offline
Zparx wrote:
I understand that. Like I know how scrollers work, but I mean I don't know how I would make a platform move on it's own in game, while also moving with the scroller. ):
Just give the platform a
change [scrollx v] by (0.2)or something.
forever set x to (((scrollx) + [offset amount]) + (independent movement)) change [independent movement v] by (2) if <(independent movement) > [too much]> // These are for programming baddies. point in direction (90 v) // These only work if the sprite only faces left-right. end if <(independent movement) < [too little]> point in direction (-90 v) endwould work.
Last edited by 360-International (2012-01-30 15:38:28)
Offline
360-International wrote:
Zparx wrote:
I understand that. Like I know how scrollers work, but I mean I don't know how I would make a platform move on it's own in game, while also moving with the scroller. ):
Just give the platform a
change [scrollx v] by (0.2)or something.
If you want objects to move independently, I would guess that aforever set x to (((scrollx) + [offset amount]) + (independent movement)) change [independent movement v] by (2) if <(independent movement) > [too much]> // These are for programming baddies. point in direction (90 v) // These only work if the sprite only faces left-right. end if <(independent movement) < [too little]> point in direction (-90 v) endwould work.
Omg! Thank you so much! That's exactly what I was looking for! I will be sure to include you in the credits section of the final game! Going to go check out your projects now (: Again, thank you!
Offline
Zparx wrote:
Omg! Thank you so much! That's exactly what I was looking for! I will be sure to include you in the credits section of the final game! Going to go check out your projects now Again, thank you!
You're welcome
EDIT: To get the smileys to work, face them to the right. If you don't want them to work, check "Never show smilies as icons for this post" near the "Submit" button.
Last edited by 360-International (2012-01-30 16:14:30)
Offline
Topic closed
Pages: 1