Ledger Nano X - The secure hardware wallet
SHARE
TWEET

GMS2 Limiter la position d'un objet v1

flashjaysan May 17th, 2020 462 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. if keyboard_check(vk_right)
  2. {
  3.     x += 5;
  4. }
  5. if keyboard_check(vk_left)
  6. {
  7.     x -= 5;
  8. }
  9. if keyboard_check(vk_down)
  10. {
  11.     y += 5;
  12. }
  13. if keyboard_check(vk_up)
  14. {
  15.     y -= 5;
  16. }
  17. if x < 0
  18. {
  19.     x = 0;
  20. }
  21. if x > room_width - 1
  22. {
  23.     x = room_width - 1;
  24. }
  25. if y < 0
  26. {
  27.     y = 0;
  28. }
  29. if y > room_height - 1
  30. {
  31.     y = room_height - 1;
  32. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top