Coder Social home page Coder Social logo

wormyjs's Introduction

This project has been discontinued, there are a lot of good canvas engines out there, i'd rather work on something more exotic. https://github.com/MarcoWorms/asciiD

WormyJs

HTML5 pure JS + canvas game engine

alt text

Latest release - https://jsfiddle.net/1c57vhs1/18/

Hi there! I'd like to talk about this engine's purpose.
I'm an amateur gamedev who likes to fastly protoype a game mechanic just to see how it's like. I'm writing this to be a "game prototyping engine", my goal here is to make a fast approach to common basic gamedev needs like "draw a colored square(or circle) instead of an sprite" or "give me fast basic collision". I came from ruby to js and this idea was inspired by Gosu, Phaser and Construct2.
Any feedback is welcome :)

Alpha notes:

GameObject properties: x, y, width, height, shape
GameObject methods: centerX, centerY, r, distanceTo, boundingBox, isColliding, draw

*both draw() and isColliding() will adjust itself accordingly to it's shape

*spherical GameObjects will be drawn based on centerX and centerY of it's boundingBox

How to use the Engine:

  • You should override: initialize(), update() and draw()
  • Initialize your GameObjects in "initialize()"
  • "update()" runs 60 times/s, use deltaTime modifier for framerate independency. Use this for your game logic.
  • "draw()" is called right after update. Use this for drawing your GameObjects
  • Use "this.drawText()" to draw text
  • this.keysDown contains user input

*both background and default drawing colors can be set at "clearCanvas()" method on the Engine object.

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.