Coder Social home page Coder Social logo

moduscreateorg / evade2 Goto Github PK

View Code? Open in Web Editor NEW
18.0 14.0 11.0 110.54 MB

EVADE2 Source code for the Arduboy platform

License: MIT License

C++ 10.84% C 66.85% JavaScript 0.02% Shell 0.09% Makefile 0.34% Batchfile 0.01% Assembly 0.03% Logos 0.43% Objective-C 0.26% Roff 0.08% HTML 20.74% CSS 0.30% Java 0.01% Ruby 0.01%
arduino arduboy-game arduboy 8bit

evade2's Introduction

EVADE 2 by Modus Create

Evade 2

Evade 2 is an Arduboy game developed by Modus Create as a holiday gift to friends and family in December 2017.

The game took about 3 weeks to create, from start to finish.

Please see the Arduboy game we made last year, Evade.

This repository contains the source code to the game, which we're making freely available and open source, under the MIT license.

We believe we pushed the Arduboy hardware in ways that will benefit future programming efforts. Feel free to use the source code here to enhance your own projects. Or feel free to make your own improvements to Evade 2 for your own pleasure.

IDE Setup

In order to compile the game and upload it to the Arduboy, we've used the Arduino IDE. We don't use the IDE features except to compile and upload our sketch (the game) to the device.

A nice quick start guide can be found here: https://community.arduboy.com/t/quick-start-guide/2790

The following instructions are a brief summary of the steps found at the link above.

Download and install the Arduino software

The IDE can be found here: https://www.arduino.cc/en/Main/Software

The IDE download will be a .zip file. Unzip it and run the install.sh file from within. For Mac, unzip the file and drag the App to your Applications folder.

Install the Arduboy2 library

Launch the IDE and under the Sketch menu there is an Include Library menu item; select Manage Libraries... from there.

Search for "Arduboy" in the search field and press install on the Arduboy2 entry.

Install support for Arduboy board

In the IDE, select File -> Preferences. In the Settings tab, enter the following URL into the "Additional BOards ManagerURLs" field:

https://arduboy.github.io/board-support/package_arduboy_index.json

Click "OK" to save.

Then Select Tools > Board: "some name" > Boards Manager...

In the search box at the top, enter "arduboy" (without the quotes) and click on the Install button for the "Arduboy by Arduboy Team" entry.

External Editor

Select File -> Preferences and click the "Use external editor" checkbox. You will then be able to use the editor of your choice to edit the project sources. You will only use the IDE to compile (the check button), or compile and upload (the right arrow button).

Restarting the IDE

It is mandatory to restart the IDE any time you pull into your git working set. The IDE keeps caches of various things like precompiled header files, and it gets confused by changes to the directory structure.

In general, if you have any doubt, it doesn't hurt to restart the IDE.

Connect your Arduboy via USB

On linux, you can see the device via ls /dev/tty* - it will be something like /dev/ttyACM0.

On Mac, the device will be something like /dev/cu.modemxxx.

Open the project in the IDE

Launch the IDE and select File > Open... and naviate to the directory containing the .ino file and select that file.

Select board type and port

From the IDE, select Tools > Board and choose "Arduboy"

Then select Tools > Port and select the /dev/ device you found via the ls command above.

Upload the sketch

Click on the right arrow button in the IDE toolbar. The sketch should compile and then upload to the device.

If you just want to compile, to check for warnings and errors, click the check button.

(TBD code overview, links, screenshots)

EVADE 2 gameplay

Credits

Designed by Jay Garcia

Music by Jay Garcia and Delio Brignoli

Art by Michael Tintiuc and Jay Garcia

Programming by Jay Garcia, Delio Birgnoli, Michael Tintiuc, and Mike Schwartz

evade2's People

Contributors

dxxb avatar grgur avatar jaygarcia avatar michaeltintiuc avatar mrblinky avatar mschwartz avatar obscurerichard avatar rpigu-i avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

evade2's Issues

Sound issues:

  1. We need a STFU call to quiet everything.
  2. Music needs to loop.
  3. We need a stop music call.
  4. It would be nice to be able to have a function called when music is complete
  5. It would be nice to be able to have a function called when sound effect is complete.

B button afterburner

B button is afterburner.

Afterburner consumes energy.

When energy is empty, afterburner stops working.

Maybe power up you shoot or crash into that gives you more energy?

Energy slowly regenerates.

svg image tool should generate decimal, not hex.

There's no benefit to generating hex values inside the image data. The hex is actually much harder to read, and all the values are ones we care to read as decimals.

Also, the compiler generates warnings for the conversions since 0xff is both -1 and 255 and 255 doesn't fit into a signed byte!

Enemies

Enemies

  • 3 types
  • 1 type of enemy projectile --- Laser

Merge Hud and Player . Make Player a class.

Power and health and that sort of thing really belong in the Player class.

Player is currently not written as a class, but it could be expressed as one.

Likely enemies and bullets should be classes, too.

Float for Z so we don't have wrap around issues as Z grows.

Z currently a word, so we have 16M or so before the universe wraps and we get some rounding errors.

Making Z a float will greatly increase the range before wrap. Probably to a point we'll never ever see it unless we leave the game running for days and we don't have some level ending logic.

Vector Objects

Render Object as a vector object, per Jay's tool output

Vector fonts class

Implement Font class to render vector font to the screen.

Remove reliance on Print class.

Fixed point math

Convert all usages of float to fixed point. Implement fixed point math routines. Implement sin/cos lookup table for fixed point maths.

Player Weapons

Weapons:

  • Lasers - B_BUTTON
  • Plasma cannon - A_BUTTON
    (Should be rechargeable like EVADE )

BCD math

Any numbers we keep internally that need to be displayed on screen should be done as BCD. We would need a BCD class that knows how to add and subtract and render.

Music & SFX

This will be an on-going task until we get to production and will me marking PRs against this.

All Music and SFX will leverage the Sound Class that @mschwartz created.

Score count mechanics.

Score to be counted similar to EVADE 1
Travel, enemy hits, enemy deaths.
Score to be presented at the end of the game

Game instructional insert

Let's try to make another instructional insert like the prior art. @jaymesjones, please work on setting up whatever milestones are required to get this printed and delivered NLT 12/13/2017.

LEDs

Make the LEDs do something

Bosses

Bosses

  • 3 types
  • Last boss larger than the screen,
  • Targeted spots on enemies/bosses to do damage / blow off parts

Player class

Handle controls, move camera, render hud, deal with resources, etc.

Player controls

Controls:

  • UP_BUTTON == “Nose down” == Playfield go up, ship travels down
  • DOWN_BUTTON == “Nose up” == Playfield go down, ship travels up.
  • A_BUTTON (left-most red button) == “Fire rechargeable plasma cannon”
  • B_BUTTON (right-most red button) == “Fire repeatable laser”

Enemy health

Enemies need to have a concept of health or shields, so it takes multiple hits to destroy.

Vector character set

This ticket is just for the creation of the character set.

I think we can get away with just capital letters A-Z, 0-9, and a few punctuation marks (like period, comma, exclamation point)

img/ directory

We can make an evade/img directory and then:

#include "img/whatever.h"

This will allow us to keep all those image .h files out of the main directory.

Eliminate Arduboy2 class

We might be able to just use Arduboy2Core class. We'd have to implement our own sBuffer and our own drawImage methods.

The amount of RAM savings is unknown at this point. We may have a performance boost as well as code savings.

Render fonts in 3D space

Object class has hooks to implement string rendering instead of array of lines.

The strings should be rendered scaled and rotated just like any object.

Maybe theta should rotate around x instead of z.

Flash saving ideas

Remove arduboy.nextFrame() call.
- Savings 160 bytes.
- Don't know if this is really needed, given all the processing we're doing.
- Files affected:
- evade.ino
- Change:
- Comment out:
// if (!(arduboy.nextFrame()))
// return;

Cache rotate/scale/etc.

If new start point of next line in image is the same as the the last end point, we already calculated the rotate/scale/etc. so we can just use it!

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.