Skip to content
프로젝트

소개

HTML5 game framework

게임 및 에뮬레이션

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

Arctic.js

Canvas Framework for smartphone

DOWNLOAD

GETTING STARTED

  1. Download Arctic.js

  2. Load Arctic.js

<html>
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"/>
    <title>Game</title>
</head>
<body>
    <canvas id="canvas"></canvas>
    <script type="text/javascript" src="js/arctic.js"></script>
    <script type="text/javascript" src="js/game.js"></script>
</body>
</html>
  1. Create a game class in your JavaScript file
var GameMain = arc.Class.create(arc.Game, {
    initialize:function(params){
        console.log(params.hp);
    },
    //This method is called in every frame
    update:function(){

    }
});
  1. Use the game class
window.addEventListener('DOMContentLoaded', function(e){
    //Pass the width and height of your game and id of the canvas element
    var system = new arc.System(320, 416, 'canvas');

    //The second parameter will be passed as a parameter of initialize method in the game class
    system.setGameClass(GameMain, {hp:100, mp:100});

    system.addEventListener(arc.Event.PROGRESS, function(e){
        console.log(e.loaded + ", " + e.total);
    });

    system.addEventListener(arc.Event.COMPLETE, function(){
        console.log('loaded');
    });

    //After finishing its loading, an instance of the game class will be created automatically
    system.load(['a.png', 'b.png']);
}, false);

LICENSE

  • MIT License

관련 프로젝트 살펴보기

불러오는 중…