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: plateform game movements theory  (Read 1228 times)

0 Members and 1 Guest are viewing this topic.

noseblunt3

Woodman is awesome
plateform game movements theory
« on: May 13, 2008, 12:32:31 am »
  • *
  • Reputation: +2/-0
  • Offline Offline
  • Gender: Male
  • Posts: 132
I started messing around with a plateform game in GM7, but I have trouble figuring out how to make the player "follow" the level.
How do you make him go up and down the hills?

I had no problems doing this with a "square" layout, because the sloppes are constants:

but I don't really know how to do it with a "curvy" layout. I don't want working code, just theories on how to make this.
Logged
Rome wasn't built in a day, but they didn't waste time by sitting around doing nothing either!
Re: plateform game movements theory
« Reply #1 on: May 13, 2008, 12:40:45 am »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 2245
Logged
Re: plateform game movements theory
« Reply #2 on: May 13, 2008, 07:15:31 am »
  • The Dark Lord is here...
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 29
You can use a loop something like this:
Code: [Select]
var i;
for (i = 0; i <= max_height_you_can_climb; i += 1)
{
  if (place_free(x+your_speed, y+i))
  {
    x += your_speed;
    y += i;
  }
}
Logged
Darth RPG - Feel Dark Side temptation

  • The Legend of Cerda Website
Re: plateform game movements theory
« Reply #3 on: May 13, 2008, 03:27:44 pm »
  • *
  • Reputation: +3/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6629
I presume you would use this.
http://en.wikipedia.org/wiki/Separating_axis_theorem
SAT is really meant for using with prefab geometry shapes, cubes, lines, circles, .etc. Its not very usefull when you have abstract shapes like in that picture.

Anyway, look at Darth RPG's example, tracking the ground height on the side the character is moving in and then adjusting accordingly is proberly best.
Logged

noseblunt3

Woodman is awesome
Re: plateform game movements theory
« Reply #4 on: May 14, 2008, 02:42:55 am »
  • *
  • Reputation: +2/-0
  • Offline Offline
  • Gender: Male
  • Posts: 132
Thanks for the ideas, it's working perfectly.
Logged
Rome wasn't built in a day, but they didn't waste time by sitting around doing nothing either!
Pages: [1]   Go Up

 


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



Page created in 0.038 seconds with 45 queries.

anything