Ruch w Game Maker

Ruch platformowy

Grawitacja

if !instance_place(x,y+1,solid) gravity=0.5
if instance_place(x,y+1,solid) gravity=0
if vspeed>10 vspeed=10

Lądowanie

if vspeed > 0 && !place_free(x,y+vspeed) move_contact(270)
vspeed = 0

Ruch GTA

if (keyboard_check(vk_left)) direction+=5;
if (keyboard_check(vk_right)) direction-=5;
if (keyboard_check(vk_up) ) speed=3;
else if (keyboard_check(vk_down) ) speed=-2;
else speed=0;

Ruch czołgu

   if(keyboard_check(vk_up)){
      speed=5
      if(keyboard_check()){
         direction+=3;
         speed-=2.5
      }
      if(keyboard_check(vk_left)){
         direction-=3;
         speed-=2.5;
      }
   }else if(keyboard_check(vk_down)){
      speed=-5
      if(keyboard_check(vk_right)){
         direction+=3;
         speed+=2.5
      }
      if(keyboard_check(vk_left)){
         direction-=3;
         speed+=2.5;
      }
   }else{
      speed=0;
      if(keyboard_check(vk_right))direction+=6;
      if(keyboard_check(vk_left))direction-=6;
   }

Ruch samochodu

   if(keyboard_check(vk_up)){
      speed=5
      if(keyboard_check(vk_right))direction-=6;
      if(keyboard_check(vk_left))direction+=6;
   }else if(keyboard_check(vk_down)){
      speed=-5
      if(keyboard_check(vk_right))direction+=6;
      if(keyboard_check(vk_left))direction-=6;
   }else speed=0;
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License