Addictive Mobile Game
- 3 Devlogs
- 18 Total hours
A mobile game
A mobile game
Another update with the game, things are really starting to come together with the game feel and world design
tween functiontilemaps and Sprite2Ds to make different zones.I am yet to figure out how to stitch the chunks together.
This is the difficulty logic
enemies_left_to_spawn = 5 + (current_wave + 2)
spawn_cooldown = max(0.4, 1.5-(current_wave * 0.1))
We have a base amount of 5 plus the extra enemies + 2 and the extended time it take to spawn zombies making each wave slightly longer than the previous one.
#Imperfect spawning of zombies
One thing I am noticing, is that some of the zombies are spawning inside of the bushes and are just stuck there, the player can’t shoot the zombie because of collision layers and the game is ‘hardstuck’ I am yet to work on how to fix it
Something also that I’ve have noticed consistently is that the bullets sometimes not fire that well, it appears that they might be hitting the player and not spawning? I have been scratching my head on this bug for a while, any suggestions will be GREAT!
Have a look at the screenshots and comment down below what you think the following structures look like! (This feedback will be very helpful! I’ll tell the answers in the next devlog!)
Just made a new shotgun and a machine gun and a melee weapon to go with the original pistol.
However, this was not the smoothest journey…
The biggest headache was a bug where the shooting worked perfectly in the bottom-left quadrant of the screen but went completely wild in the other three. It turned out to be an issue with local versus global coordinates when mixing the player node’s position and the muzzle position. I fixed it by bypassing the muzzle’s relative math entirely and calculating the trajectory straight from the player’s core global position. Now aiming and shooting are perfectly consistent all 360 degrees around the player.
I wired up the static reload sprites so they actually show up visually. The issue before was that the sprite swap was happening after the timer finished, so it never showed up. Now it swaps to the reload frame instantly when you press R, and then swaps back to the normal shooting frame when the timer finishes. I also made it so that the second your mag drops to zero, it calls the reload function automatically without making you click an extra time.
here is how I made the different gun types
enum GunType { PISTOL, SHOTGUN, MACHINE_GUN, KNIFE}
var gun_stats = {
GunType.PISTOL: {"current_ammo": 7, "ammo_max": 7, "reload_time": 1.0, "spread": 0, "projectiles": 1, "is_automatic": false, "is_melee": false},
GunType.SHOTGUN: {"current_ammo": 2, "ammo_max": 2, "reload_time": 2.0, "spread": 0.22, "projectiles": 5, "is_automatic": false, "is_melee": false},
GunType.KNIFE: {"current_ammo": 1, "ammo_max": 1, "reload_time": 0.4, "spread": 0, "projectiles": 0, "is_automatic": false, "is_melee": true},
GunType.MACHINE_GUN: {"current_ammo": 30, "ammo_max": 30, "reload_time": 2.2, "spread": 0.08, "projectiles": 1, "is_automatic": true, "is_melee": false}
}
Mobile-Friendly Drag and Release Controls
I completely changed how aiming and firing work to make the game ready for a mobile layout. Instead of just clicking to shoot, you now hold down the mouse button (or your finger on a screen) to bring up the trajectory line and aim. For semi-auto weapons like the pistol and shotgun, you rotate around as much as you want to frame the shot, and the gun fires the exact moment you release the button. For the machine gun, it continuously fires while you hold it down but limits the rate of fire with a quick cooldown loop so it doesn’t empty all 30 rounds in one frame. The player also keeps turning smoothly even when they aren’t actively clicking.
I also made a test level to get an idea of how the level will be layered out. Check out the video! (if it loads…)
Just working on the basic player movement as well as shooting mechanic. Looks basic (I know) BUT.
If there’s anything you should know, it’s that you should always, make sure that the mechanics actually work rather than making the game look pretty.
This is going to be a top-down mobile game and hopefully with joysticks. But for now I am using WASD and mouse.
I am trying to go for a Brawl Stars kind of UI, but that will be seen in the future.
Next I will be working on a reloading and magazine system!
See you then!