ユーザ用ツール

サイト用ツール

サイドバー

About

Contents

Materials Link

その他

PR


wiki:enchant.js:tips:002

002 ひな形の作成

概要

ゲーム作成用のひな形を用意します。

ソースコード

<!-- index.html -->
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, user-scalable=no"> 
		<meta name="apple-mobile-web-app-capable" content="yes"> 
		<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
		<title>template</title>
		<script type="text/javascript" src="js/enchant.js"></script>
		<script type="text/javascript" src="js/main.js"></script>
		<style type="text/css">
			body {
				margin: 0;
				padding: 0;
			}
		</style>
	</head>
	<body>
	</body>
</html>
 // main.js
 enchant();
 window.onload = preloadAssets;
 
 var game;
 var scene;
 
 function preloadAssets()
 {
 	game = new Game(320,480);
 	game.onload = init;
 
 	game.start();
 }
 
 function init()
 {
 	game.scale = 1;
 	game.fps = 30;
 	scene = new Scene();
 	scene.backgroundColor = "#000";
 	game.pushScene(scene);
 
 	main();
 }
 
 function main()
 {
 	game.addEventListener(Event.ENTER_FRAME,enterFrame);
 }
 
 function enterFrame(e)
 {
 }

ダウンロード

Permalink wiki/enchant.js/tips/002.txt · 最終更新: 2014/11/07 09:10 (外部編集)

oeffentlich