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

26 lines
592 B
JavaScript
Raw Normal View History

2020-02-29 08:27:07 +01:00
import asdf from "../../../asdf/index.js";
const { Game, Container, CanvasRenderer, math, KeyControls, MouseControls, Text, Texture, Sprite, TileSprite } = asdf;
const game = new Game(640, 320, true);
const { scene, w, h } = game;
import King from "../entities/King.js";
import Snake from "../entities/Snake.js";
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');
}
});