//Gravity
if place_free(x,y+1) {gravity = 0.65}
else {gravity = 0}
gravity_direction = 270
//Limiting the vspeed
if vspeed > 10 {vspeed = 20}
//Moving
if keyboard_check(vk_right) && place_free(x+5,y) {x+=5}
if keyboard_check(vk_left) && place_free(x-5,y) {x-=5}
//Jumping
if keyboard_check_pressed(vk_up) && !place_free(x,y+1) {vspeed = -9}
if vspeed > 0 && !place_free(x,y+vspeed) {move_contact(270)}
vspeed = 0
Tags: how, script, gravity, engine
Download| Released | 2009-02-13 |
| Category | Platform |
| Rating | 3.4 (by 7 users) |
| Downloads | 150 |
| Version | 0 |
| ID | 70595 |
| Slug | gravity-engine |