diamond-game
v0.4.8
Published
create 2d game easier
Maintainers
Readme
#first install the package
npm install diamond-game#then create html file like this and run with live server :
<!DOCTYPE html>
<html lang="en">
<head>
<title>Game</title>
</head>
<body style="padding: 0px;margin: 0px;overflow:hidden">
<canvas
style="width: 100vw;height: 100vh;margin: 0px;"
id="canvas"
></canvas>
<script type="module" src="./test.js"></script>
</body>
</html>#you can test the package like this :
// test.js
import Game from "./node_modules/diamond-game/dist/index.js";
let { test } = Game("canvas");
//test with simple game
test();#then you can create your own game by these method :
import Game from "./node_modules/diamond-game/dist/index.js";
let {
loop,
Gravity,
canvas,
ctx,
drawObject,
test,
GameObject,
Controller,
backInside,
Rect,
LoadImage,
Sound
} = Game("canvas");