From 0fa4bb23e9ccd24b39011474fa3d13f157fd7dbc Mon Sep 17 00:00:00 2001 From: Stefan Stefanov Date: Wed, 8 Jan 2025 22:53:35 +0200 Subject: [PATCH] added carrot item, not handling drop of items other than tomato yet however --- assets/carrot_item.png | Bin 0 -> 204 bytes src/globals.odin | 7 +++++++ src/resources.odin | 7 +++++++ 3 files changed, 14 insertions(+) create mode 100644 assets/carrot_item.png diff --git a/assets/carrot_item.png b/assets/carrot_item.png new file mode 100644 index 0000000000000000000000000000000000000000..04c4f8de119a10fcbd830d77f7bc0837c75a3c54 GIT binary patch literal 204 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|+B{txLo9le z6C^ATSO@>NH!D;N;xXK`@rXf7>x5MU0fs`mGXjfv9k$2nJr@YO z&AIEr>CMs>bNencq}=ArJeI|vbLFFDbpazoP`L5omgMsffi7b3boFyt=akR{0MYYH A%>V!Z literal 0 HcmV?d00001 diff --git a/src/globals.odin b/src/globals.odin index b232a63..2613a06 100644 --- a/src/globals.odin +++ b/src/globals.odin @@ -46,6 +46,9 @@ InventoryItem :: enum { tomato, tomato_seed, tomato_seedling, + carrot, + carrot_seed, + carrot_seedling, //Other } @@ -130,11 +133,15 @@ init_hotbar_from_inventory :: proc() { append(&hotbar.tool_slots, item) } case .tomato_seed: + fallthrough + case .carrot_seed: if amount > 0 { append(&hotbar.seed_slots, item) } case .tomato: case .tomato_seedling: + case .carrot: + case .carrot_seedling: } } } diff --git a/src/resources.odin b/src/resources.odin index 95d2179..a478d6e 100644 --- a/src/resources.odin +++ b/src/resources.odin @@ -8,6 +8,7 @@ pickup_sound_data: []u8 : #load("../assets/sounds/pickup_sound.mp3") player_spritesheet_sprite: []u8 : #load("../assets/player.png") tomato_spritesheet_sprite: []u8 : #load("../assets/tomato.png") tomato_item_sprite: []u8 : #load("../assets/tomato_item.png") +carrot_item_sprite: []u8 : #load("../assets/carrot_item.png") sell_button_sprite: []u8 : #load("../assets/sell_button.png") background_sprite: []u8 : #load("../assets/background.png") tool_ui_npatch_sprite: []u8 : #load("../assets/tool_ui_npatch.png") @@ -29,6 +30,7 @@ tool_ui_npatch: rl.NPatchInfo tile_dirt_dry_texture: rl.Texture2D tile_dirt_wet_texture: rl.Texture2D tomato_texture: rl.Texture2D +carrot_texture: rl.Texture2D hoe_texture: rl.Texture2D scythe_texture: rl.Texture2D watering_can_texture: rl.Texture2D @@ -97,6 +99,7 @@ load_resources :: proc() { tile_dirt_dry_texture = load_texture_from_memory(tile_dirt_dry_sprite) tile_dirt_wet_texture = load_texture_from_memory(tile_dirt_wet_sprite) tomato_texture = load_texture_from_memory(tomato_item_sprite) + carrot_texture = load_texture_from_memory(carrot_item_sprite) hoe_texture = load_texture_from_memory(hoe_sprite) scythe_texture = load_texture_from_memory(scythe_sprite) @@ -117,6 +120,7 @@ load_resources :: proc() { // Starting inventory player_inventory[.tomato_seed] = 5 + player_inventory[.carrot_seed] = 5 player_inventory[.hoe] = 1 player_inventory[.watering_can] = 1 player_inventory[.scythe] = 1 @@ -135,6 +139,9 @@ load_resources :: proc() { .tomato = &tomato_texture, .tomato_seed = &tomato_texture, .tomato_seedling = &tomato_texture, + .carrot = &carrot_texture, + .carrot_seed = &carrot_texture, + .carrot_seedling = &carrot_texture, } }