Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

GM8 Collision Problem

Hi! I am using GM8 and I am making a game where your player changes to an animated sprite when he walks. The problem is that the new sprite with animation (walking) someway get stuck in the "ground" (solid objects). It hacks when I walk with my player_object. How do I fix this, and is the sprite mask in a special form that makes the sprite/object get stuck in the solid object(s)? I have automatic ; rectangle mask for the ANIMATED sprite and Precise Collision Checking also set to it.

HERES MY PAYER_OBJECT INFO:
Information about object: Mario

Sprite: sprite6
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent: <no parent>
Mask: Collision mask

Create Event:
execute code:

grav=.3;
mspeed = 8;

Step Event:
execute code:

if (place_free(x,y+1)) {
gravity = grav;
}else{
gravity = 0
}

Collision Event with object Mark:
start moving in directions 000010000 with speed set to 0

Collision Event with object Mark:
start moving in directions 000010000 with speed set to 0

Collision Event with object Mark:
execute code:

vspeed = 0;

Collision Event with object Victory Mark:
execute code:

vspeed = 0;

Collision Event with object OFF Block:
execute code:

vspeed = 0;

Keyboard Event for <Space> Key:
execute code:

if!(place_free(x,y+1)) {
vspeed -= 8;}

Keyboard Event for P-key Key:
display message: GAME PAUSED

Other Event: Outside Room:
for other object: jump to the start position
set the number of lives relative to -1

Other Event: Game Start:
set the score to 0
set the number of lives to 5
set the information in the window caption:
show score with caption score:
show lives with caption lives:
don't show health with caption health:

Other Event: No More Lives:
display message: TRY AGAIN !!!
show the highscore table
background: Donut Plains
show the border
new color: 16384, other color: 255
Font: "Times New Roman",10,255,0,0,0,0
restart the game

Key Press Event for <Left> Key:
set speed to 3 and direction to 180
set the sprite to MovingLEFT with subimage 0 and speed 1

Key Press Event for <Right> Key:
set speed to 3 and direction to 0
set the sprite to MovingRIGHT with subimage 0 and speed 1

Key Release Event for <Left> Key:
start moving in directions 000010000 with speed set to 0
set the sprite to sprite6 with subimage 0 and speed 1

Key Release Event for <Right> Key:
start moving in directions 000010000 with speed set to 0
set the sprite to sprite13 with subimage 0 and speed 1

BUT is there something I have missed and/or done wrong? Please help me!!

Here's a record of my problem:

http://www.youtube.com/watch?v=WL7eOkkYD_s
 
Information about object: Mario

Sprite: sprite6
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent: <no parent>
Mask: Collision mask

Create Event:
execute code:

grav=.3;
mspeed = 8;

Step Event:
execute code:

if (place_free(x,y+1)) {
gravity = grav;
}else{
gravity = 0
}

Collision Event with object Mark:
start moving in directions 000010000 with speed set to 0

Collision Event with object Mark:
start moving in directions 000010000 with speed set to 0

Collision Event with object Mark:
execute code:

vspeed = 0;

Collision Event with object Victory Mark:
execute code:

vspeed = 0;

Collision Event with object OFF Block:
execute code:

vspeed = 0;

Keyboard Event for <Space> Key:
execute code:

if!(place_free(x,y+1)) {
vspeed -= 8;}

Keyboard Event for P-key Key:
display message: GAME PAUSED

Other Event: Outside Room:
for other object: jump to the start position
set the number of lives relative to -1

Other Event: Game Start:
set the score to 0
set the number of lives to 5
set the information in the window caption:
show score with caption score:
show lives with caption lives:
don't show health with caption health:

Other Event: No More Lives:
display message: TRY AGAIN !!!
show the highscore table
background: Donut Plains
show the border
new color: 16384, other color: 255
Font: "Times New Roman",10,255,0,0,0,0
restart the game

Key Press Event for <Left> Key:
set speed to 3 and direction to 180
set the sprite to MovingLEFT with subimage 0 and speed 1

Key Press Event for <Right> Key:
set speed to 3 and direction to 0
set the sprite to MovingRIGHT with subimage 0 and speed 1

Key Release Event for <Left> Key:
start moving in directions 000010000 with speed set to 0
set the sprite to sprite6 with subimage 0 and speed 1

Key Release Event for <Right> Key:
start moving in directions 000010000 with speed set to 0
set the sprite to sprite13 with subimage 0 and speed 1

There you go;)
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top