Advertisement
Guest User

some codes i used ;D

a guest
Nov 26th, 2014
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.65 KB | None | 0 0
  1. /// Drop the item
  2. if (global.item != -1)
  3. {
  4.     if (instance_position(mouse_x, mouse_y, obj_inventory_box) && global.game_state= 'pause')
  5.     {
  6.         var box = instance_position(mouse_x, mouse_y, obj_inventory_box);
  7.         //slot empty
  8.         if (box.item == -1 && (box.type == scr_get_item_value(global.item, 'type') || box.type == ''))
  9.         {
  10.             //put the item in the box
  11.             box.item = global.item;
  12.             global.item = -1;
  13.         }
  14.         else
  15.         {
  16.             //drop item
  17.             instance_create(obj_player.x, obj_player.y, global.item);
  18.             global.item = -1;
  19.         }
  20.     }
  21.     else
  22.     {
  23.         instance_create(obj_player.x, obj_player.y, global.item);
  24.             global.item = -1;
  25.     }
  26. }
  27. //take the item from the inventory box
  28.  
  29. if (( item != -1) && global.game_state == 'pause')
  30. {
  31.     global.item = item;
  32.     item = -1;
  33. }
  34. //player Movements
  35. if ((keyboard_check(ord('S')) || keyboard_check(vk_down))  && place_free(x,y+4))
  36. {
  37.     y+=4
  38. }
  39. if ((keyboard_check(ord('W'))|| keyboard_check(vk_up)) && place_free(x,y-4))
  40. {
  41.     y-=4
  42. }
  43. if ((keyboard_check(ord('A'))|| keyboard_check(vk_left)) && place_free(x-4,y))
  44. {
  45.     x-=4
  46. }
  47. if ((keyboard_check(ord('D'))|| keyboard_check(vk_right)) && place_free(x+4,y))
  48. {
  49.     x+=4
  50. }
  51. ///spawn hp bar and mana bar
  52. if (instance_exists(obj_player) && room != rm_menu && !instance_exists(obj_hpbar))
  53. {
  54.     instance_create(view_xview[0]+xstart, view_yview[0]+ystart,obj_hpbar)
  55. }
  56. if (instance_exists(obj_player) && room != rm_menu && !instance_exists(obj_manabar))
  57. {
  58.     instance_create(view_xview[0]+xstart, view_yview[0]+ystart,obj_manabar)
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement