Page 1 of 1

LunaLua with Link

Posted: Sun Nov 26, 2017 1:27 am
by Devan2002
How would someone make it so that if Link dashes and hits a wall (whether it's the top half or bottom half) he bounces off it, creating the bonk noise (while in the hurt frame when bouncing back)?

Re: LunaLua with Link

Posted: Sun Nov 26, 2017 1:40 am
by The0x539
keep track of last tick's speedX
if current speedX is zero and last frame's was not, and player is pushing against a wall, set speedX to minus last tick's speedX

Re: LunaLua with Link

Posted: Sun Nov 26, 2017 2:02 am
by Devan2002
The0x539 wrote:keep track of last tick's speedX
if current speedX is zero and last frame's was not, and player is pushing against a wall, set speedX to minus last tick's speedX
This would also include several things, like changing the frame of Link to the hurt animation until he stops falling, it plays a sound effect, and Link moves up a few pixels.

Re: LunaLua with Link

Posted: Sun Nov 26, 2017 9:22 am
by The0x539
sounds like you have a decent idea how to do those things