Giter Club home page Giter Club logo

sosengine's Introduction

SOSEngine

2D Game Engine based on HTML markup written for MMORPG 2D Game

YouTube video: https://www.youtube.com/watch?v=DHoUlHN6YO0.
That is my old abandoned project of 2D engine. I had written it before I learned WebGL/OpenGL. JavaScript ES5 syntax.

Usage

  1. Include source JS files and CSS file. Set your .window size in CSS file.
  2. Add this snippet to your HTML file. You can use more this structure.
<div id="SOSEngine" class="SOSEngine">
  <div class="window">
    <div class="scene" data-width="200" data-height="200" data-texture="#fff">
    </div>
  </div>
</div>
  1. In your JS file, you have to set scale and create SOSEngine.Scene, SOSEngine.Window and SOSEngine.Camera. You can set the scale only one time and before initialization. Remember: less scale == less performance!
SOSEngine.scale = 12;
var engine = SOSEngine.make($('#SOSEngine'));
  1. Add some static objects to scene. Data round and texture are optional. Static objects should be included in the collision calculation.
<div class="object" data-x="15" data-y="15" data-width="10" data-height="10" data-round="0" data-texture="#000"></div>
  1. Add standard object to your scene.
var props = {height: 5, width: 5, posX: 30, posY: 30};
var myObject = new SOSEngine.Object(props.width, props.height, props.posX, props.posY);
engine.Scene.add(myObject);

sosengine's People

Contributors

stanfortonski avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  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.