asdf-games/examples/tile-test/src/main.js

26 lines
597 B
JavaScript
Raw Normal View History

2020-02-29 13:45:56 +01:00
var asdf = require('../../../lib/index');
2020-02-29 08:27:07 +01:00
const { Game, Container, CanvasRenderer, math, KeyControls, MouseControls, Text, Texture, Sprite, TileSprite } = asdf;
const game = new Game(640, 320, true);
const { scene, w, h } = game;
2020-02-29 13:45:56 +01:00
var King = require("../entities/King.js");
var Snake = require("../entities/Snake.js");
2020-02-29 08:27:07 +01:00
var snake = new Snake();
console.log(snake);
scene.add(snake);
for (let index = 0; index < 250; index++) {
scene.add(new King());
}
const mouseAim = new MouseControls();
game.run((dt ,t) => {
if (mouseAim.isDown) {
console.log('cliccccccccccc');
}
});