This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var sprite = new game.Sprite('sprite.png'); | |
// Hide sprite | |
sprite.visible = false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var sprite = new game.Sprite('sprite1.png'); | |
// Set new texture for sprite | |
sprite.setTexture('sprite2.png'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var player = new game.Sprite('player.png'); | |
var weapon = new game.Sprite('weapon.png'); | |
weapon.position.set(100, 100); | |
player.addChild(weapon); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// You can define module attributes in config file | |
pandaConfig = { | |
system: { | |
width: 640, | |
height: 480 | |
}, | |
debug: { | |
enabled: true, | |
color: 'white' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pandaConfig = { | |
sitelock: 'pandajs.net' | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var sprite = new game.Sprite('sprite.png'); | |
var tween = new game.Tween(sprite.position); | |
tween.to({ x: 200 }, 1000); | |
tween.start(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var tween = new game.Tween(sprite.position); | |
tween.to({ x: 200 }, 1000); | |
tween.easing('Quadratic.InOut'); | |
tween.start(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
game.module( | |
'game.main' | |
) | |
.body(function() { | |
game.addAsset('panda.png'); | |
SceneGame = game.Scene.extend({ | |
init: function() { | |
var sprite = new game.Sprite('panda.png'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
game.module( | |
'game.main' | |
) | |
.body(function() { | |
game.addAsset('panda.png'); | |
SceneGame = game.Scene.extend({ | |
init: function() { | |
var sprite = new game.Sprite('panda.png'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
game.module( | |
'game.main' | |
) | |
.body(function() { | |
game.addAsset('panda.png'); | |
SceneGame = game.Scene.extend({ | |
init: function() { | |
var sprite = new game.Sprite('panda.png'); |