Full game
https://flicventure.itch.io/vikinginvaders
I struggled to come up with a concept for this game, I eventually landed on doing a game based on Vikings, where the player is a dragon stopping them from attacking his homeland.

On the topic of the dragon, here’s his code. This code covers two things, the movement, and the bullets.
For the Movement code, it basically says that the player will move horizontally at the set speed.
The bullet code is describing that the bullet will fire at a certain speed, from the player’s location when the space bar is pressed.

the next code is for the boat, or the enemy, like the aliens in the original. This covers the boat’s movement, this is what is making the boat move down the map.

Finally the bullet code! First, we have the bullet behavior, this code is propelling the bullet forward until it hits anything marked an enemy, where it’s destroyed itself and the game object.
BUT! What if the bullet misses? Then we just have random bullets off in the void, floating forever, so that’s where the second code is for, if a second bullet is created then the first one is destroyed.


At this point I had a pretty functional game, although I had a couple of issues, so here’s how I fixed them;


My first issue was the boats, if the player didn’t manage to shoot them, they would just go off being the player and carry on forever. to stop this I created a bit of code and attached it to a red block just out of sight of the camera. The second issue was the player could move off the side of the screen and technically just go sideward forever. So I placed two white blocks and put rigid body on them and the player sprite, so the game would see both as solid and not let the player pass through the white blocks, thus confining it to just the camera view.
Leave a Reply