Omnimaga

Calculator Community => TI Calculators => Axe => Topic started by: leafy on March 24, 2011, 10:50:53 pm

Title: Moving Platforms
Post by: leafy on March 24, 2011, 10:50:53 pm
What I have problems with is not creating the platform but getting the player to detect the platform and move with it. Pixel-detection can detect, but not cause the player to move with the platform.
The best way I can come up with is to use a combination of pixel testing and looping through all the objects to move the player, but is there a better way?
Title: Re: Moving Platforms
Post by: phenomist on March 24, 2011, 10:52:10 pm
Uh, instead of looping through all the objects, maybe check all of the objects touching the player instead?
Title: Re: Moving Platforms
Post by: leafy on March 24, 2011, 10:52:30 pm
You have to loop through all the objects to see which ones are touching the player :P
Title: Re: Moving Platforms
Post by: phenomist on March 24, 2011, 10:53:49 pm
Wouldn't you have to loop through all the objects to perform movement operations on the moving platforms anyways? Maybe implement a player check within this.
Title: Re: Moving Platforms
Post by: Deep Toaster on March 25, 2011, 10:58:30 am
That still doesn't move the player along with it, though...

Maybe store the movement of the object in a temporary variable, then just before moving the object check if the object's close enough to the player, and if so add its movement to that of the player as well?