Giter Site home page Giter Site logo

canvas-prime's People

Contributors

ashblue avatar gkoehl avatar

Stargazers

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

Watchers

 avatar  avatar

canvas-prime's Issues

NullPointer problem

If you put the logic to kill an entity in the update function you can run into situations where the core class will try and draw an object that isn't there.

Check if entity type exists

A simple function should be available to check if an entity type exists. Should return true or false.

Example:

if (entityType(name,count)) {
    // do stuff
}

Separate update and draw

Draw and update need to be split into two separate loops. Draw should handle animation and intervals should handle the logic. Need to experiment before proceeding.

Garbage Collection

Currently garbage collection is insufficient and doesn't actually clear out everything necessary. Some kind of cleaning worker or asynchronous event might be necessary.

Consider the following method:
a = {
b: 'asdf',
c: 'fdsa'
};

Delete it as so:
delete a;

Only the a element is cleared and the remaining pieces can still be accessed as so. This could build up lots and lots of garbage over time.
a.b; // Returns proper value
a.c; // Returns proper value

Entities Not Clearing

Global id's not clearing from memory after kill is called. Also storage isn't emptying properly and items aren't clearing from it.

Location Set Inconsistent

Creation of one location string instead of using multiple strings. Too messy and hard to set right now.

Sound Support

  • Requires a sound handling library
  • Should make use of .mp3 or .ogg depending upon browser sniffing results

Animation properties must be set

If animation properties aren't set it will cause an object to explode. Make it so offset, flip, and other props don't need to be set.

Basic Gravity

Game needs a basic gravity module that developers can build off of if necessary.

Key.press with multiple inputs

If we try to use multiple inputs we are only capturing one currently:

In player.js:

    if (Key.press('arrowLeft') && this.x > 0)
        this.x -= this.speed;
    if (Key.press('arrowRight') && this.x < Game.width - this.width)
        this.x += this.speed;
    if (Key.press('arrowUp') && this.y > 0)
        this.y -= this.speed;
    if (Key.press('arrowDown') && this.y < Game.height - this.height)
        this.y += this.speed;

HTML5 Canvas Engine Comparison Tests

Canvas Prime is incredibly fast. To prove it I'm going to compile a list of the most popular HTML5 game engines and run a basic stress test across all of them.

Documentation Writing

The functions all need to be documented, general concepts need to be detailed, and a proper forum should be setup for feedback.

Mouse Support

  • Requires a mouse monitoring library similar to keyboard.js
  • Needs active monitoring mouse coordinates relative to Canvas

Killing objects during collision

If you run kill during a collide, it will cause the collision loop to collapse. Killed objects should be placed into a graveyard for later removal instead of running kill immediately.

Replace Class Inheritance Script

Right now John Resig's JavaScript Prototypical Inheritance script works for what we need, but it suffers from some speed issues and doesn't quite meed the needs of the engine. It needs to be re-written and replaced at some point.

Debug Mode

Include a simple debug mode capable of the following (only available in production version before compiling):

  • Visual collision indicators
  • FPS monitoring
  • Entity total

Needs to be placed beneath the game content with a slide up and down window mechanism.

Compiler Script

Include compiler script that compresses and consolidates all JavaScript code into a single file, re-organizes assets, and removes exploitable code.

Math Library

A library of math comparison functions such as distance, angle to, and more would be very useful.

Orientation API

Would be nice to have the orientation API available through a dependency.

Random off by 1

Random is off by 1. Needs to use this structure instead of the current.

return Math.floor(Math.random() * (max - min + 1)) + min; 

Touch Support

With HTML5 touch support quickly growing across mobile devices, its time to start considering how to integrate it with Canvas Prime. After the mouse library has been integrated, this feature will be further detailed.

Loader Callback Fail

Entities are loading asynchronously instead of one after another, needs to be changed.

Double entity init

It seems that init is running twice for entities due to:

    spawn: function(x,y) {            
        if (x) this.x = x;
        if (y) this.y = y; 
        this.init(); // removing this line will fix the issue
        return this;
    }

Dynamic Object Creation

Any object you instantiate in the game.js file will be created on load. Need to make a spawn function that will control when an object is created. Ran into this issue when trying to make feather particles and I was unable to set when the objects were supposed to appear.

Open Source

Engine is open source, need to place a basic license in with the core files.

Naming of press push functions

The naming of press push functions in the keyboard library is a little confusing.

Press seems to be for holding the button down. Push is for a one time click.

Asset Loading Screen

Loads all images, sound files, and other junk via AJAX. Needs a pretty loading bar too.

spawnEntity with new settings

When initializing an object old values of the same object will be overwritten. Need to create a solution where you take a new value in the spawn function and apply these to the newly created object.

Image Handling

  • Flip function for object images
  • Image animation handler
  • Needs to include sprite support that's stored inside a variable
  • Z-index emulation
  • Image offset x and y

Level Editor

A grid based level editor that runs in browser and includes entity interaction needs to be included in the game at some point.

Needs to at least have basic trigger integration.

Timers

Users need to be able to create timers on the fly from the engine's core. Time will be measured according to real time and not frames.

Should be a dependency file and users will create objects as so:

this.timer = new Timer(duration);

Test for timers current time as so:

// Test to see if the timer has expired
this.timer.expire() returns t or f

Plugins

Decide how to handle and manage plugins.

Image flipping

Need a method to easily flip an image that will take into consideration the canvas offset.

Calling parent functions

Need to find a good way to call parent/super functions, unclear about how classes absorb parent functions.

Gravity

Built in gravity or a gravity plugin would be very useful.

Cleanup PHP Code

Right now the PHP code is kinda crappy. Could be much better written and consolidated.

Storage array won't clear objects from memory

When you call the function kill() on a class to remove it from the storage array, if you take a look at the DOM in firefox it will show the name spaces for all the killed files and their variables are still accessible.

Object creation

Can't create more than one object without creating a completely new constructor.

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.