Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

HTML5 game framework

License

NotificationsYou must be signed in to change notification settings

Arcticjs/Arctic.js

Repository files navigation

Canvas Framework for smartphone

DOWNLOAD

GETTING STARTED

  1. Download Arctic.js

  2. Load Arctic.js

<html><head><metahttp-equiv="content-type"content="text/html; charset=UTF-8"><metaname="viewport"content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"/><title>Game</title></head><body><canvasid="canvas"></canvas><scripttype="text/javascript"src="js/arctic.js"></script><scripttype="text/javascript"src="js/game.js"></script></body></html>
  1. Create a game class in your JavaScript file
varGameMain=arc.Class.create(arc.Game,{initialize:function(params){console.log(params.hp);},//This method is called in every frameupdate:function(){}});
  1. Use the game class
window.addEventListener('DOMContentLoaded',function(e){//Pass the width and height of your game and id of the canvas elementvarsystem=newarc.System(320,416,'canvas');//The second parameter will be passed as a parameter of initialize method in the game classsystem.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 automaticallysystem.load(['a.png','b.png']);},false);

LICENSE

  • MIT License

About

HTML5 game framework

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors5


[8]ページ先頭

©2009-2025 Movatter.jp