Powered by Invision Power Board

 
    Reply to this topicStart new topicStart Poll

> Game Maker landing problems [SOLVED]
Canada
Mewizkuit
Posted: Jun 13 2008, 06:34 PM
Quote Post


CHARMANDER
[*][*][*][*]

Group Icon
Group: Members
Posts: 4397
Member No.: 2508
Joined: 16-August 06

Status: (0d) [--]


Its something that always seems to happen in platformers I make.
If the character lands on a platform that has a different y position than the platform you jumped or fell from, he stops a pixel or so above the ground, waits there a while, then hits the ground. This makes it hard to move around smoothly and is just plain annoying. Can anyone help?

Code: in the character objects step event it checks if there is floor object below it. If there is, the gravity is set to 0. Otherwise, it is set to 1.

This post has been edited by Dr. Light on Jun 13 2008, 08:01 PM


--------------------
QUOTE
whenever i feel like clicking "reply"
i stop and think to myself, "why"
will it be a post to be remembered by?
or will i scare off a n00b and tell him to die?
PMEmail PosterMSN
Top
United States
Ianprime0509
  Posted: Jun 13 2008, 07:07 PM
Quote Post


My favorite E3 game so far
[*][*]

Group Icon
Group: Members
Posts: 488
Member No.: 3316
Joined: 17-February 07

Status: (0d) [--]


Do you have more code in the Collision with Block event? You should have something that also sets the vspeed to 0.


--------------------

user posted imageuser posted imageuser posted image
Signature version 3.0
PMEmail Poster
Top
Finland
Ultramario
Posted: Jun 13 2008, 07:16 PM
Quote Post


Dan Dan Dan!
[*][*][*][*][*]


Group Icon
Group: Members
Posts: 11240
Member No.: 2164
Joined: 9-June 06

Status: (0d) [--]


I use this:
CODE
if y < other.y
{y = other.y-32
vspeed = 0}

Replace 32 with something suitable.

EDIT: Put this into the collision event with block.

This post has been edited by Ultramario on Jun 13 2008, 07:16 PM


--------------------
PMEmail PosterUsers WebsiteAOL
Top
Canada
Mewizkuit
Posted: Jun 13 2008, 07:57 PM
Quote Post


CHARMANDER
[*][*][*][*]

Group Icon
Group: Members
Posts: 4397
Member No.: 2508
Joined: 16-August 06

Status: (0d) [--]


QUOTE (Ianprime0509 @ Jun 13 2008, 07:07 PM)
Do you have more code in the Collision with Block event? You should have something that also sets the vspeed to 0.

Ya thats there. Forgot to mention it.


--------------------
QUOTE
whenever i feel like clicking "reply"
i stop and think to myself, "why"
will it be a post to be remembered by?
or will i scare off a n00b and tell him to die?
PMEmail PosterMSN
Top
Canada
Mewizkuit
Posted: Jun 13 2008, 08:00 PM
Quote Post


CHARMANDER
[*][*][*][*]

Group Icon
Group: Members
Posts: 4397
Member No.: 2508
Joined: 16-August 06

Status: (0d) [--]


QUOTE (Ultramario @ Jun 13 2008, 07:16 PM)
I use this:
CODE
if y < other.y
{y = other.y-32
vspeed = 0}

Replace 32 with something suitable.

EDIT: Put this into the collision event with block.

Wow that seemed to work!
Thanks alot! Finally I can start making platformers again!


--------------------
QUOTE
whenever i feel like clicking "reply"
i stop and think to myself, "why"
will it be a post to be remembered by?
or will i scare off a n00b and tell him to die?
PMEmail PosterMSN
Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

  Topic Options Topic Options Reply to this topicStart new topicStart Poll

 




[ Script Execution time: 0.0435 ]   [ 14 queries used ]   [ GZIP Enabled ]   [ Server Load: 0.22 ]