Options
All
  • Public
  • Public/Protected
  • All
Menu

@m0ksem/bronze

Bronze-Engine

Simple game engine based on WebGL with JavaScript.

Docs - Development plan - Editor

Examples

  • 🏗 Dev ploygon - polygon for testing new features.
  • 🎯 Aim training - simple game shooter game.
  • 👻 Horror - the horror game, showing the possibilities of light in the engine..

    Using (vanillaJS)

  • Setup
    Download last realese and use it
    <script src="Bronze.min.js"></script>
  • Define engine
    // Creating instance of engine
    var engine = new Bronze.Engine(canvas)
    // Creating camera for engine
    var camera = new Bronze.Camera(engine)
    // You can also define controls object for control camera or objects.
    var controls = new Bronze.Controls(engine)
  • Map building
    // Create all texture files
    var texture = new Bronze.Texture(engine)  
    texture.setColor(159, 136, 105, 255)  // If engine draws before all resources loaded color will be shown
    texture.loadFrom("path/to/texture.png")
    // Creating instance of some object
    var object = new Bronze.Object(Engine)
    object.loadFromObj("path/to/object.obj")
    object.setTexture(texture)
    // We can transform him
    object.setPosition(0, 200, 500)
    object.setRotation(0, 90, 45)
    object.scale(2, 3, 2)
    // Also we can set animation function
    object.animate(60, (obj) => {
        obj.rotate(+1, 0, 0)
        if (!(obj.position.y == 100)) {
          obj.move(0, -10, 0)
        }
    })

    Development

    `console

    Install dependencies

    yarn install

Serve with hot reload at localhost:8080

yarn dev

Production build with minification

yarn run build

Create docs

yarn run build:docs `

Author

© Nedoshev Maksym

Generated using TypeDoc