Closed 1sra3l closed 3 years ago
@igorfs10 I am implementing movement between locations, via the ui.forward
and ui.backward
and emitting a signal.
Should "forward" simply cycle through the Locations, or should there be some sort of long sequence we iterate over?
Something similar to a map that starts in a town and is linear, like:
let map = [Town,
Forest, Forest, Forest, Forest, Forest, Forest,
Town,
Cave, Cave, Cave, Cave, Cave, Cave,
Town,
Desert, Desert, Desert, Desert,
Town,
Forest, Swamp, Swamp, Forest];
// etc...
let mut place = 0;
if forward {
place += 1 ;
} else if backward {
place -= 1;
}
// check range, etc..
let location : Location = Location::get_location(&map[place]);
Please let me know if the images fail to load when you run it, since you are on Windows. I use fs::canonicalize
so I hope it reads everything correctly, since I use Unix paths for the locations::Location.image
Worked great on windows, I just need to let compiler copies assets file to target folder. I liked the emit function, I guessed I had to use set_callback for everything. Nice work 👍
@igorfs10 Thanks! I may still tweak the artwork, but I was excited to get a bit of a working "game" going. Have you thought about what library to use for music? I put some ogg files in a folder, listen to the file on loop to see what you think. I made all of them very short loops (7-8 seconds).
My next commit will update the readme and add screenshots. I'll wait a bit on it, so you can play around with the code and change whatever you want to!
I added two backgrounds to get started seeing what the game might look like