Skip to content

A 100% vanilla JavaScript-made game about butterflies and flowers. Submission for the Indie Game Garage Jam #0.

License

Notifications You must be signed in to change notification settings

joelalejandro/fly-butterfly

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fly, Butterfly

A 100% vanilla JavaScript-made game about butterflies and flowers. Submission for the Indie Game Garage Jam #0.

Technologies and tools used

  • Aseprite
  • HTML, CSS, JavaScript
  • Visual Studio Code

How the engine works

The Game class is composed by the following components:

  • Controls: takes care of the player input (both keyboard and mouse events are supported).
  • Scene: renders a viewport for the game. Everything about the elements rendered on screen is contained here.
  • Player: a special class that wraps the sprite for the player object (in this case, the Butterfly). It interacts with the controls and the scene.
  • Score: a UI component to keep track of how much points the player has scored.
  • Life: a UI component that keeps track of how many life points the player has left.

As soon as the game starts, it renders everything in the UI and fires up the Spawner implementations that the game requires. For Fly, Butterfly, there's a FlowerSpawner that will render either Flower 1 or Flower 2 on a variable frequency, determined by the game level and the amount of points the player has scored.

On each frame, there's a collision detection between the player object and all of the rendered flowers. While both sprites are colliding, the hovered flower is consumed and the player's life points are increased.

Take a look inside the files and see the magic ✨

Why all Vanilla JS? Why not Phaser or {type your engine here}?

Because it's a Game Jam, and it's all about experimenting!

License

Feel free to use anything from this repo and remix it as you see fit. Keep in mind that the music track has a license of its own.

About

A 100% vanilla JavaScript-made game about butterflies and flowers. Submission for the Indie Game Garage Jam #0.

Resources

License

Stars

Watchers

Forks

Packages

No packages published