Organize project
This commit is contained in:
parent
d6143951d8
commit
6993054d63
7 changed files with 368 additions and 327 deletions
43
src/resources.odin
Normal file
43
src/resources.odin
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
package game
|
||||
|
||||
import rl "vendor:raylib"
|
||||
|
||||
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")
|
||||
sell_button_sprite: []u8 : #load("../assets/sell_button.png")
|
||||
background_sprite: []u8 : #load("../assets/background.png")
|
||||
tile_dirt_dry_sprite: []u8 : #load("../assets/tile_dirt_dry.png")
|
||||
tile_dirt_wet_sprite: []u8 : #load("../assets/tile_dirt_wet.png")
|
||||
|
||||
load_texture_from_memory :: proc(data: []u8) -> (texture: rl.Texture2D) {
|
||||
img := rl.LoadImageFromMemory(".png", raw_data(data), auto_cast len(data))
|
||||
defer rl.UnloadImage(img)
|
||||
texture = rl.LoadTextureFromImage(img)
|
||||
return texture
|
||||
}
|
||||
|
||||
load_sound_from_memory :: proc(
|
||||
data: []u8,
|
||||
sound_extension: cstring = ".mp3",
|
||||
) -> (
|
||||
sound: rl.Sound,
|
||||
) {
|
||||
wav := rl.LoadWaveFromMemory(sound_extension, raw_data(data), auto_cast len(data))
|
||||
defer rl.UnloadWave(wav)
|
||||
sound = rl.LoadSoundFromWave(wav)
|
||||
return
|
||||
}
|
||||
|
||||
pickup_sound: rl.Sound
|
||||
|
||||
sell_button_texture: rl.Texture2D
|
||||
background_texture: rl.Texture2D
|
||||
tile_dirt_dry_texture: rl.Texture2D
|
||||
tile_dirt_wet_texture: rl.Texture2D
|
||||
tomato_texture: rl.Texture2D
|
||||
|
||||
player_animation: Animation
|
||||
tomato_animation: Animation
|
||||
Loading…
Add table
Add a link
Reference in a new issue