Guest User

Game Maker Koopa Troopa Codes

a guest
Oct 13th, 2013
437
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.58 KB | None | 0 0
  1.  
  2. Player Create Event:
  3.  
  4. right = true
  5.  
  6.  
  7. Koopa Create Event:
  8.  
  9. sprite_index = spr_koopa_walk_l
  10. image_speed = 0.3
  11. image_index = 0
  12. hspeed -= 3
  13.  
  14. Koopa Step Event:
  15.  
  16. //I put simple DnD gravity here but you can put in code gravity if you like
  17.  
  18. Collision with Player Obj Event:
  19.  
  20. if (other.vspeed > 0 && other.y+8 < y)
  21. {
  22. other.vspeed=-5
  23. instance_change(obj_koopa_shell,true)
  24. }
  25.  
  26. Koopa Collision with Regular Collision Obj Event:
  27.  
  28. //Again I just put some DnD actions here those actions being: Move to Contact (direction = direction, maximum = 12, against = solid objects) and Speed Vertical (vert. speed = 0)
  29.  
  30. Koopa Collision with Reverse Collision Obj Event:
  31.  
  32. Same as above event but with a DnD Reverse Horizontal
  33.  
  34. if sprite_index = spr_koopa_walk_l
  35. {
  36. sprite_index = spr_koopa_walk_r
  37. image_speed = 0.3
  38. image_index = 0
  39. }
  40. else
  41. {
  42. sprite_index = spr_koopa_walk_l
  43. image_speed = 0.3
  44. image_index = 0
  45. }
  46.  
  47. Koopa Outside Room Event:
  48.  
  49. instance_destroy()
  50.  
  51.  
  52. Koopa Shell Create Event:
  53.  
  54. speed = 0
  55.  
  56. Koopa Shell Step Event:
  57.  
  58. //DnD Gravity, feel free to put in your own gravity system whether it be code or DnD
  59.  
  60. Koopa Shell Collision with Obj Player Event:
  61.  
  62. if (other.vspeed > 0 && other.y+8 < y)
  63. {
  64. other.vspeed=-5
  65. if other.right = true
  66. {
  67. hspeed-=5
  68. }
  69. if other.right = false
  70. {
  71. hspeed+=5
  72. }
  73. }
  74.  
  75. Koopa Shell Collision with Regular Collision Obj:
  76.  
  77. //I just put some DnD actions here those actions being: Move to Contact (direction = direction, maximum = 12, against = solid objects) and Speed Vertical (vert. speed = 0)
  78.  
  79. Koopa Shell Outside Room Event:
  80.  
  81. instance_destroy()
Advertisement
Add Comment
Please, Sign In to add comment