Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: [1]   Go Down

Author Topic: [Need help getting started] Efficient Link sliding on Ice  (Read 1678 times)

0 Members and 1 Guest are viewing this topic.

King Tetiro

Leader of Phoenix Heart
[Need help getting started] Efficient Link slidi...
« on: December 16, 2011, 10:57:02 am »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3549
As you know, in Chiming Bells, Link and Chia are heading to the Frozen Peaks. Now what sort of icy mountain would it be if it didn't have ice that you slide along when you stop running.

One problem though. The last time I attemped such a engine feature, it went horribly wrong. So rather than attempt it without having a clue, this time I'm going to ask ZFGC for tips and hints towards getting it to work.

So let's start with a question. How does the Link sliding on Ice feature work in terms of programming?
Logged
  • Phoenix Heart

TDWP FTW

Forstride Productions
Re: [Need help getting started] Efficient Link s...
« Reply #1 on: December 16, 2011, 11:04:02 am »
  • Forstride Productions
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 106
There are probably a lot of ways you could do it, but the way I'd do it is something like:

Code: [Select]
if position_meeting(x,y,objIcePatch)
     {
     if keyboard_check_pressed(vk_left/right/whatever)
          {
          if iceslide = 0
               {
               iceslide = 1
               //movement code here
               }
          }
     }

So that way it'll only set it once, and you'll only be able to move once iceslide = 0 again, which you'll have to set with collisions into walls or whatever.

You'll also need to set a check with your regular movement code for iceslide = 0 so you can't move until you stop sliding.

I just came up with this on the spot, and I haven't tested it yet, so let me know if it works or not.
Logged
Re: [Need help getting started] Efficient Link s...
« Reply #2 on: December 16, 2011, 06:11:11 pm »
  • *
  • Reputation: +8/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6604
I coded something which was an improved version of Goodnight's movement which also did ice movement most effectively. Whether or not you would use tiles for main collision objects, you would be able to easily use the tile method for ice surfaces.
Logged
Pages: [1]   Go Up

 


Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved



Page created in 0.09 seconds with 43 queries.