Gamemaker: Basic collisions without solid objects.

Published: 11 April 2014
on channel: Sea Blu
20,763
96

Today I make my first game maker tutorial in three years, and show you how to create/use basic platformer collisions without the use of the solid variable.


CODE:

~ OBJ_CHAR ~

Step Event
if !place_meeting(x,y+1,obj_block)
{gravity=1.3 gravity_direction=270}

else
{gravity=0 gravity_direction=270}

Collision Event
if other.blocksolid = 1
{x=xprevious
y=yprevious
move_contact_all(direction,12) vspeed=0}

Left Event
if !place_meeting(x-6,y,obj_block)
{x -= 6}

Up Event
if place_meeting(x,y+5,obj_block)
{vspeed = -11}

Right Event
if !place_meeting(x+6,y,obj_block)
{x += 6}


~ OBJ_BLOCK ~

Create Event
blocksolid = 1

QSF Facebook page:   / quickshotfilms  
QSF Website: http://qsdevelopment.toppysites.com/

Made using serif movieplus x6.

Hope you enjoyed :)


On this page of the site you can watch the video online Gamemaker: Basic collisions without solid objects. with a duration of hours minute second in good quality, which was uploaded by the user Sea Blu 11 April 2014, share the link with friends and acquaintances, this video has already been watched 20,763 times on youtube and it was liked by 96 viewers. Enjoy your viewing!