aphid attack! banner

aphid attack!

12 devlogs
10h 2m 3s

A game where aphids attack you and you have to shoot them! Written in lua with love2d!

This project uses AI

Used ai for math and code formatting, as well as the html file

Demo Repository

Loading README...

nmsoukmandjiev007

Shipped this project!

I made a little top down shooter in Lua and love2d where you have to shoot down aphids for the final week of lockin!!!! It was a fun way to learn lua and taught me a lot about game mechanics in general! I hope you enjoy the game!!
PSA The controls are WASD and left click to shoot!

nmsoukmandjiev007

Made a readme!
Time to just host it on the interweb and ship!!!!

Attachment
0
nmsoukmandjiev007

The gameplay loop is finally finished!
Its fairly simple, you survive hoards until you die, and then you get an evaluation, which is time * score!
Then youll be judged by how many points you get, and it will give you a ranking!
This actually taught me a bit more of the love api as i figured out how to draw specific areas of a sprite, meaning that i packed all of my letters into one single sprite!
Aside from that the game is pretty much done!
Todo:
Readme
Web build
Draw a few more assets
Ship!!!!!

Attachment
2

Comments

vishalya18
vishalya18 about 14 hours ago

ooo the sprites are so cute!!

nmsoukmandjiev007
nmsoukmandjiev007 about 14 hours ago

Thank you!

nmsoukmandjiev007

Added a menu!
It was fairly straigthforward, all i made was a little bobbing title and a start button!
The start button is just a placeholder, as it starts the game anyways, but its perfectly fine for a game of that sort of scope

I also partially implemented the state machine!

Todo!
Web build
End screen
Readme

0
nmsoukmandjiev007

Got the web build working!!
Its still not hosted anywhere, but it exists on my laptop!
Todo!
Menu
Win screen
Readme
Ship!

Attachment
0
nmsoukmandjiev007

Added quite a few things!!
Firstly, i added powerups!!
Its currently just a health box and a fertiliser. The health box obviously regenerates some of your health, and the fertiliser halves your shooting rate, which shreds the aphids!
Then i also added some info at the top for things like your health, aphids killed and the time survived!
I finally also added collisions between ladybug and aphid, as well the ladybug flashing when it gets hit to indicate invincibility!
I will now focus on these things!
Menu!
Win screen
Web build :O

So far its going quite well!

Attachment
0
nmsoukmandjiev007

Added a dying animation for the aphids!!
This was SOOO painful becuase im still not experienced with the love api (and lua itself), but i eventually got there and managed to make a dying animation where the aphids slowly shrink!
This was mainly done by creating a “dyingaphid” table so that the aphids dont interfere with collision, and so that the scale can be stored internally.
Overall it looks really nice, so now ill focus up on other aspects of the game!
Todo!
Powerups
Main menu
Health/invincibility
Sound!

1

Comments

SilentSword
SilentSword 4 days ago

This looks amazing!

nmsoukmandjiev007

The gameplay loop exists!!!
Its mainly just gonna be a wave shooter where it progressively gets more difficult!
Anyways to do that i added a little fuction that spawns aphids every few seconds, and it works likea charm!
Also made the background a type of green!
Todo!
Sound
Menu
Aphid death animation!

0
nmsoukmandjiev007

Aphid collision is now added!
I decided to try out radial collision instead of normal bounding box collision, whihc was a fun challenge, and it works quite well too!
The only issue is that it is an O(n^2) collision so it could lag in more intensive situations, but since a maximum of like 15 aphids will exist during a game i dont think itll kill performance too much, plus there isnt a much better way other than writing complicated collision systems
I also added bullets which are little particles that can collide with the aphids (aabb this time)
They were also quite straightforward to program and they work perfectly fine too!

Todo
gameplay loop
sound
main menu
background

0
nmsoukmandjiev007

Added the aphid ai!
The aphids facing the ladybug was pretty much recylced mouse to ladybug code, so it works perfectly fine!
The ai was quite simple too, as it was mainly just pythagoras to find the diagonal closest to the ladybug, and then normalise the vector!
The issue is that they ALL follow the same path, meaning that eventually they will overlap. I have two fixes i can think of right now
Make them each have a unique speed so that some aphids will not be able to catch up and others will blitz through the swarm
Add collision!

Ill probably implement both, but i might focus on other things for now!
Todo!
What i just mentioned
Animations
Shooting
Periodical spawning

0
nmsoukmandjiev007

I added movement and rotation!
It was quite confusing since i decided to apply deltatime, but aside from that it works fine!
I made the rotation track the mouse position at the center of the sprite, which was quite easy, as it was just atan mousepos - spritepos
I also added the start of the shooter code, where it opens the wings, but nothing actually gets shot

Todo!
Shooting,
aphids spawning
walking animations!

Its going really well so far!!!

0
nmsoukmandjiev007

Got the development environment set up, cant wait to see how this will progress!

Attachment
0