0
\$\begingroup\$

I am building an top-down 2d RPG like zelda. I have been trying to implement ice sliding. I have a tile with the slide property. I thought it would be easy to get working. I figured that I would read the slide property, and move the character forward until the slide property no longer exists. So I tried a loop but all it did was stop at the first tile in an infinite loop. I then took the loop out and tried taking direct control of the character to move him along the slide path but I couldn't get it to move.

Is there an easy way to do an ice sliding tile based movement in libgdx. I looked for a tutorial but none exist.

\$\endgroup\$
  • 1
    \$\begingroup\$ Are you using velocity to control your character? If so then you could just set the velocity to a constant variable and send your character off in that direction... I've never played Zelda so I'm not sure what the ice tiles are like in that but I'm thinking of the Pokemon ice tile where you don't stop until you get off it it \$\endgroup\$ – Savlon Jun 8 '14 at 8:20
  • \$\begingroup\$ Yes. I'm using x and y velocity to move the character. I tried giving it a value but the character just stood there waiting for input from the user. The ice tiles in pokemon is exactly like what I'm trying to replicate. \$\endgroup\$ – Jeremy Clarkson Jun 8 '14 at 18:35
  • \$\begingroup\$ Ok so when the player walks on the ice tile you set the velocity and then add the velocity to the players position... You did that and it didn't work? Post that part of your code \$\endgroup\$ – Savlon Jun 8 '14 at 23:10
1
\$\begingroup\$

Many games do not handle player movement as a purely binary moving/not moving system, but model the players movement through acceleration, deceleration and top-speed. The result is a much more natural movement. In such a system, a slippery floor is essentially free, because you can just reduce acceleration and remove automatic deceleration when the player isn't moving.

|improve this answer|||||
\$\endgroup\$
0
\$\begingroup\$

Tweening

Also known as "Easing" and "Inbetweening". But basically, if you use it in movement, (See the very bottom link) it could give you the smooth, ice-walking animation you want.

Webopedia defines it as;

Short for in-betweening, the process of generating intermediate frames between two images to give the appearance that the first image evolves smoothly into the second image. Tweening is a key process in all types of animation, including computer animation. Sophisticated animation software enables you to identify specific objects in an image and define how they should move and change during the tweening process. (http://www.webopedia.com/TERM/T/tweening.html)

Also, you can find it in this amazing talk about adding "Juice" (More gameplay output per input) to your game here; (http://youtu.be/Fy0aCDmgnxg?t=2m38s)

|improve this answer|||||
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.