← View other post-mortems
Post-mortem

Nuclear Sniper

Pavel Drotár
Lv. 2
Pavel Drotár Level 2
· 2 min read · 24 views
Nuclear Sniper
Nuclear Sniper
· 8th

Welcome, fellow developer, gamer, or just an interested party, to the Post-Mortem of "Nuclear Sniper".

1
Joining the Jam
I learned about the GM48 number 47 when it was already running for about 10 hours, on Saturday morning local time, and decided to join it on a whim; meanwhile, my game Swarming Asteroids was already pretty far done for the Pirate Jam, which started 5 days earlier and still had another 9 days to go -- so I paused working Swarming Asteroids (SwAs) and switched to a new project for GM48.

I realized quickly that I will have to be very efficient on the graphics side, because my understanding of the rules was that usage of bought assets is not permitted, and I managed to completely miss the assets made available for everyone. So, I quickly drew a bunch of primitive sprites for the cars and the buildings and the dashed line for the targetting beam, the simple 'hero' character and the huge nuclear bullet, and got to work on the game logic.


2
Initial Coding

Initially, I coded the car objects to use the Step event to simply move from left to right according to their speed (in 'pixels per second') per delta_time. Similarly, as soon as a building would break into pieces, each of those pieces would calculate its speed and direction based on its position within the building footprint compared to the impact point, and then use the Step event to move along.

However, as soon as I started implementing the time manipulation, it became obvious that this won't work; the chief problem being that you can also CLICK anywhere on the timeline to simply jump to that moment -- which would make the bullet to skip from its initial position to some position beyond a target (a building or a car) -- and the collision event for bullet-vs-building or bullet-vs-car would never trigger.