Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /// @description Add Later
- depth = -1; //Draw inventory above lighting
- scale = 2;
- show_inventory = false;
- inv_alpha = .5;
- inv_slots = 16; // Amount of slots in the inventory
- inv_slots_width = 8; // Amount of slots along the width
- inv_slots_height = 3; // Amount of slots along the height
- selected_slot = 0;
- pickup_slot = -1;
- m_slot_x = 0;
- m_slot_y = 0;
- x_buffer = 2; // The space between two slots on the x
- y_buffer = 4; // The space between two slots on the y
- gui_width = display_get_gui_width();
- gui_height = display_get_gui_height();
- s_inv_ui = s_inventory_ui;
- s_inv_items = s_inventory_items;
- cell_size = 32;
- s_inv_items_columns = sprite_get_width(s_inv_items)/cell_size; //Get the amount of inventory slots per column
- s_inv_items_rows = sprite_get_height(s_inv_items)/cell_size; //Get the amount of inventory slots per row
- inv_ui_width = 288;
- inv_ui_height = 192;
- inv_ui_x = (gui_width/2) - (inv_ui_width/2 * scale);
- inv_ui_y = (gui_height/2) - (inv_ui_height/2 * scale);
- info_x = inv_ui_x + 13 * scale;
- info_y = inv_ui_y + 13 * scale;
- slots_x = inv_ui_x + 9 * scale;
- slots_y = inv_ui_y + (40 * scale);
- // ----- Player Info
- ds_player_info = ds_grid_create(2, 4);
- ds_player_info[# 0, 0] = "Aurum";
- ds_player_info[# 0, 1] = "Argenti";
- ds_player_info[# 0, 2] = "Centum";
- ds_player_info[# 0, 3] = "Name";
- ds_player_info[# 1, 0] = 0;
- ds_player_info[# 1, 1] = 0;
- ds_player_info[# 1, 2] = 40;
- ds_player_info[# 1, 3] = "PlayerName";
- // ----- Inventory
- ds_inventory = ds_grid_create(2, inv_slots);
- // ----- Items
- enum item {
- none = 0,
- tomato = 1,
- potato = 2,
- carrot = 3,
- artichoke = 4,
- chilli = 5,
- gourd = 6,
- corn = 7,
- wood = 8,
- stone = 9,
- bucket = 10,
- chair = 11,
- picture = 12,
- axe = 13,
- potion = 14,
- starfish = 15,
- mushroom = 16,
- height = 17, //Move this down on new entry creation, it tells the game how many entries there are.
- }
- // Randomly Fill the Inventory
- var yy = 0; repeat(inv_slots) {
- ds_inventory[# 0, yy] = irandom_range(1, item.height-1);
- ds_inventory[# 1, yy] = irandom_range(1, 10);
- show_debug_message("[INFO] A random Item was added to Inventory");
- yy++;
- }
- show_debug_message("[INFO] Inventory has been filled");
- show_debug_message("[INFO] Inventory Initialization finished");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement