Skip to content

Instantly share code, notes, and snippets.

@ochaochaocha3
Last active August 29, 2015 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ochaochaocha3/d37799b4fe26e34ec7bb to your computer and use it in GitHub Desktop.
Save ochaochaocha3/d37799b4fe26e34ec7bb to your computer and use it in GitHub Desktop.
enchant.js: Hello World
<!DOCTYPE html>
<html lang='ja'>
<head>
<meta charset='UTF-8'>
<title>Hello World</title>
</head>
<body>
<!-- https://github.com/uei/enchant.js-builds/blob/master/build/enchant.js からダウンロードしてくる -->
<script src='enchant.js'></script>
<script src='main.js'></script>
</body>
</html>
enchant();
window.onload = function WindowOnLoad() {
var
game = new Core(960, 640),
sceneGameMain = new Scene(),
label = new Label('Hello World');
label.x = 200;
label.y = 100;
sceneGameMain.addChild(label);
game.pushScene(sceneGameMain);
game.start();
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment