Game in 7 Days, Day 6: Cleaning up and unexpected developments
7days1game programming game fun worms
I have started by adding support for all weapon-related things. Limited and unlimited weapons, delayed weapons were the first feature to be added. After that weapon properties - explosion range (foreground and background, but for now I disabled the background explosion as it didn't look as cool as I hoped), explosion damage, and offset for making the worms jump higher in the air when hit by explosion.
After that I have added the kill conditions - damage and falling below water level. With that I have added win con (at most one team surviving damage calculation) and that was it. Whole game. At least, theoretically. Everything was a spaghetti test code that I invented as I went along. So, I took all that and started reorganising: Divided match into proper independent phases between which I could jump, say DamageProcessing or BeardlingPlacing.
Speaking of which, I forgot to mention this the previous time, at first I thought it'd be really hard. After some thinking I had the idea though:
1) Pick a random column of pixels in the level (with some margins so that your beardling doesn't spawn halfway off the screen say)
2) Go through each pixel. If it's top edge pixel (that means: pixel at (x,y) has its opacity not equal to 0 and pixel above it has its opacity equal to 0 add to 'potential spawn points'
3) Go through each potential spawn point. If beardling character could fit in the place above it, keep it on the list, if not, remove from the list
4) If the list is empty, go back to 1)
5) Go through each potential spawn point. If there is no other beardling within certain radius (so that spawned beardlings don't overlap), keep it on the list, if not, remove it
6) If the list is empty, go back to 1)
7) Pick random point from the list. Place beardling there.
I also found a solution for drawing the concrete slab: Why rotate pixels? I rotate 'blueprints', and then iterate over a normal texture. Still looks good, and it's way way faster than rotating individual pixels, without the hassle of having to draw the concrete slab in different positions. Here's the texture I will use for it, pretending to be ground texture:
But most cool of all: When I was working on the game, my girl has shown me some of the pictures that she drew as a kid. I was blown away, she really draws great! And, since I'm not a great 2D artist, I asked her if she wants to join me in the quest to create games, so that we'll become rich faster ( ;) ) and she agreed! She has draw concept sketches for the beardlings, and they were awesome. She has no experience in digital art, but she's willing to train. I have also asked her to try and draw some terrain textures for the game, and after never having drawn tiles in her life, she's created this new ground for my battles to be fought upon:
If this is her art after first day, I'm looking forward to the future. I've asked her to create me a bunch of textures for different level types, so the game will be more interesting, and she'll get some experience under her belt. Everything is going great.
See you on the last day, when I'm finally adding all the pretty explosions, menus, animations, sounds and whatever else I'll manage.
Story so far: