The VG Resource

Full Version: Need Game Maker 8.0 Wall and Wall jumping help strongly please thank you
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am using Game Maker 8.0 unregistered after PACMAN jumps and lands he gets stuck regardless except when I jump but if I try left, right especially on the right and left and top side PACMAN does not move as he is supposed to.

Here is status' (ctrl+F) PACMAN obj_wall ParentSolidObj



Information about object: PACMAN

Sprite: sprite0
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent: <no parent>
Mask: <same as sprite>

Collision Event with object obj_wall:
COMMENT: comment

Keyboard Event for <Left> Key:
set the horizontal speed to -5

Keyboard Event for <Right> Key:
set the horizontal speed to 5

Key Press Event for A-key Key:
execute code:

if ( !place_free(x,y+2) )//for Game Maker 8 on top is +
{
vspeed = -10;
gravity = 0.5;
}
if ( !place_free(x+2,y) && keyboard_check(vk_left) && !keyboard_check(vk_down) )//for Game Maker 8 x+ on right side
{
x -= 14;
vspeed = -5;
}
if ( place_free(x-2,y) && keyboard_check(vk_right) && !keyboard_check(vk_down) )
{
x += 14;
vspeed = -5;
}


Key Press Event for J-key Key:
jump to the start position

Key Release Event for <Left> Key:
set the horizontal speed to 0

Key Release Event for <Right> Key:
set the horizontal speed to 0




Information about object: obj_wall

Sprite: sprite9
Solid: true
Visible: true
Depth: 0
Persistent: false
Parent: ParentSolidObj
Mask: <same as sprite>




Information about object: ParentSolidObj

Sprite: <no sprite>
Solid: true
Visible: true
Depth: 0
Persistent: false
Parent: <no parent>
Mask: <same as sprite>
Wrong section. Moving.
Thank you Alpha Six btw awesome avatar!
Not to be mean, but why don't you post this at YoYo Games community forum? That's where a lot of GM8 programmers hang out.


Anyway, first off, in the Keyboard Check Events, you should add a place_free(x +/- =5) check before you have the sprite move +/- 5 pixels.

I think I see what you're trying to do, but the if !place_free(x+2,y) conditional could be causing problems. Keep your horizontal movement codes separate from your vertical (aka jumping) movement codes. If you want him to move at different speeds in the air (or not at all), then include that conditional with the left/right keyboard checks.

Also, y+2 IS NOT towards the top. y+2 is for falling. GameMaker has always been arranged from top-left to bottom-right, like so:

(0,0) (1,0) (2,0) (3,0)
(0,1) (1,1) (2,1) (3,1)
(0,2) (1,2) (2,2) (3,2)
(0,3) (1,3) (2,3) (3,3)