Giter Site home page Giter Site logo

aliciapaz / beetle-rush Goto Github PK

View Code? Open in Web Editor NEW
5.0 1.0 0.0 5.57 MB

An endless runner game built with Phaser 3 that makes a dung beetle run through the forest while collecting manure and avoiding predators.

Home Page: https://adoring-goldstine-1746f4.netlify.app/

License: MIT License

HTML 2.63% JavaScript 93.87% CSS 3.50%

beetle-rush's Introduction

Beetle Rush

A platform game built with Phaser 3 that makes a dung beetle run through the forest while collecting manure and avoiding predators!

screenshot

Built With

  • HTML5 & JavaScript
  • Phaser 3
  • Webpack

Live Demo

Play the live demo here!!

Getting Started

To get a local copy up and running follow these simple example steps.

Setup and Install

  • Clone this repository using the link above (click on the 'code' button)
  • Open a terminal and cd to the cloned repository
  • Once you're in the root (the outer most) directory of the proyect, run npm install
  • Run npm start to start a server (this will open a new tab in your default browser)
  • If the browser did not open after starting the server, open your preferred browser and go to http://localhost:8080/

Tests

  • Open npm run test to run the tests

Usage

Play

  • To play the game, click on the "Play" button
  • Press the UP key to jump
  • Press the UP key twice to make a double jump
  • Collect as much dung as you can you earn points
  • Avoid frogs by jumping over their heads
  • If two frogs appear very close to each other, use the double jump to evade them both!

Save your score

  • When the game is over, you can choose between saving your score or going back to the main menu
  • If you choose "Save", you will check the leaderboard. If your score is among the top five, you will see your name in the leaderboard!!

Game Design (GDD)

Main goal

To develop a platform game in which a moving background would create the illusion of a moving character, with collectable objects and enemies that end the game when they hit the player.

The original idea

What's so great about dung beetles anyway?

When I worked in ecological agriculture I grew a certain fondness for these little folks. They play a huge role in recycling organic matter in forests and farming systems! I decided to develop this game to share my passion for nature, education and programming, while learning a new framework.

Gather and prepare the assets

I made a list of all the assets I would require:

  • A background and logo images
  • A tile to use as platform
  • Sprite sheets for the player, dung(coins) and enemies
  • A nice background music to give my game a happy and exciting mood
  • Buttons and checkboxes

I looked for assets in open source art websites, such as OpenGameArt.org

Development stage

1. Set the beetle's habitat

Dung beetles live happier in diverse landscapes, with lots of forest and grassland to hang around. The goal while setting up the backgroud and platform was to give the player the feeling of a dynamic and diverse environment. This environment is made by two parts:

  • A scrolling background
  • A scrolling ground with grass

This was accomplished by using tileSprites feature from Phaser.

2. Add the player

  • Bring the dung beetle into scene and set an animation to make it run
  • Make it jump with the up key
  • Add double jump

3. Add dung to collect

  • Use object pooling to create dung "coins"
  • Set a collider object with the player, so when the dung "touches" a dung coin, it dissapears and the player gets 5 points

4. Add enemies

I asked a friend who happens to be a dung beetle specialist: "What are common predators for dung beetles?" Her answer was "birds, frogs and toads"

The process for adding frogs to the game was similar to adding the dung coins, with some slight differences:

  • Instead of being single-frame objects, I made them move by adding a simple but cool animation to the frogs
  • I reduced the size of the collidable body to be nicer with the player

5. Implement a scoring system

Because JavaScript is much more exciting with asynchronous code, I implemented a leaderboard that uses an API to save and retreive scores.

6. Testing the user experience

Once the game was over I asked some friends and family to test the game ๐Ÿชฒ

Deployment

  • Deployed on Netlify

Authors

๐Ÿ‘ค Alicia Rojas

๐Ÿค Contributing

Contributions, issues, and feature requests are welcome!

Feel free to check the issues page.

Show your support

Give a โญ๏ธ if you like this project!

Acknowledgments

๐Ÿ“ License

This project is MIT licensed.

beetle-rush's People

Contributors

aliciapaz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.