Skip to content

Instantly share code, notes, and snippets.

View ekelokorpi's full-sized avatar

Eemeli Kelokorpi ekelokorpi

View GitHub Profile
@ekelokorpi
ekelokorpi / panda.js
Last active January 25, 2023 18:10
Phaser vs. Panda
game.module(
'game.main'
)
.body(function() {
game.addAsset('logo.png');
SceneGame = game.Scene.extend({
init: function() {
var sprite = new game.Sprite('logo.png');
var sprite = new game.SpriteSheet('spritesheet.png', 80, 96);
sprite.frame(6); // Set texture to frame 6
sprite.addTo(this.stage);
game.createScene('Main', {
init: function() {
this.gameMusic();
},
gameMusic: function() {
var music = new game.Music('music.m4a');
music.play();
}
});
game.createClass('A', {
init: function() {
this.obj = new game.B();
}
});
game.createClass('B', {
test: 'hello'
});
game.module(
'game.utils'
)
.body(function() {
var seed = 0;
game.random = function () {
var x = Math.sin(.8765111159592828 + seed++) * 10000;
return x - Math.floor(x);
game.module(
'game.main'
)
.require(
'game.objects'
)
.body(function() {
});
game.module(
'game.main'
)
.body(function() {
game.createScene('Main', {
init: function() {
this.mob = new game.Mob();
this.mob.gfx.addTo(this.stage);
},
Amount amount = new Amount(
"USD",
total,
total,
0,
0,
"ROAM Discount",
0
);
@ekelokorpi
ekelokorpi / main.js
Last active May 6, 2017 19:20
Core: Require module
game.module(
'game.main'
)
.require(
'game.player'
)
.body(function() {
});
@ekelokorpi
ekelokorpi / main.js
Last active October 29, 2015 12:33
System: Accelerometer
game.module(
'game.main'
)
.body(function() {
game.addAsset('panda.png');
game.createClass('Player', {
init: function(x, y) {
this.sprite = new game.Sprite('panda.png', x, y).addTo(game.scene.stage);