15-3 コピーいち

bonemeat00

License: MIT License

Fork
0
Fav
0
View
46
  • Play

Fullscreen

Smart Phone

  • Readme
  • JavaScript 129 lines
  • HTML 1 lines
  • CSS 10 lines
/*
* ‚¨‚Ü‚¶‚È‚¢
*/
enchant();


/*
* ’萔
*/
// ƒpƒ‰ƒ[ƒ^
var SCREEN_WIDTH = 320; // ƒXƒNƒŠ[ƒ“‚Ì•
var SCREEN_HEIGHT = 320; // ƒXƒNƒŠ[ƒ“‚̍‚‚³
// ƒvƒŒƒCƒ„[
var PLAYER_WIDTH = 32; // •
var PLAYER_HEIGHT = 32; // ‚‚³
var PLAYER_SPEED = 8; // ƒXƒs[ƒh
// ‰æ‘œ
var PLAYER_IMAGE = "http://www.shoeisha.co.jp/book/shuchu/enchantsample/chapter04/player.png";
// ƒAƒZƒbƒg
var ASSETS = [
PLAYER_IMAGE
];


/*
* ƒOƒ[ƒoƒ‹•Ï”
*/
var game = null;
var player = null;


/*
* ”Ä—pˆ—
*/
// ƒ‰ƒ“ƒ_ƒ€’l¶¬
var randfloat = function(min, max) {
return Math.random()*(max-min)+min;
};


/*
* ƒƒCƒ“ˆ—
*/
window.onload = function() {
// ƒQ[ƒ€ƒIƒuƒWƒFƒNƒg‚̐¶¬
game = new Game(SCREEN_WIDTH, SCREEN_HEIGHT);
// ‰æ‘œ‚̓ǂݍž‚Ý
game.preload(ASSETS);

// ƒQ[ƒ€ŠJŽnŽž‚̏ˆ—
game.onload = function() {
var scene = game.rootScene;
scene.backgroundColor = "black";

// ƒvƒŒƒCƒ„[‚𐶐¬, •\Ž¦
player = new Player();
player.moveTo(SCREEN_WIDTH/2-PLAYER_WIDTH/2, SCREEN_HEIGHT-PLAYER_HEIGHT);
scene.addChild(player);

// ƒV[ƒ“XVŽž‚̏ˆ—
scene.onenterframe = function() {

};
};

game.start();
};


/*
* ƒvƒŒƒCƒ„[
*/
var Player = Class.create(Sprite, {
initialize: function() {
Sprite.call(this, PLAYER_WIDTH, PLAYER_HEIGHT);
this.image = game.assets[PLAYER_IMAGE];
this.frame = 0;
},
});
  • 15-3 コピーいち
  • 15-3 コピーいち

play

Complete!

Description What kind of game?

Control Device

jsdo.it websocket controller

Mouse

keyboard

smartphone

Fullscreen

Default Panel

Size

  • Width: px
  • Height: px

code

QR Code

Discussion

Questions on this code?

Tags