mirror of
https://github.com/photonstorm/phaser
synced 2025-02-18 23:18:38 +00:00
Tidying up a bit
This commit is contained in:
parent
f17cdd9c32
commit
27cea5e6f0
4 changed files with 16 additions and 15 deletions
|
@ -33,7 +33,6 @@ function create() {
|
||||||
|
|
||||||
function update()
|
function update()
|
||||||
{
|
{
|
||||||
// game.physics.collide( sprite, otherSprite ) ;
|
|
||||||
|
|
||||||
// Move sprite up and down smoothly for show
|
// Move sprite up and down smoothly for show
|
||||||
var tStep = Math.sin( counter ) ;
|
var tStep = Math.sin( counter ) ;
|
||||||
|
|
|
@ -28,8 +28,6 @@ function create() {
|
||||||
// Populate the wave with some data
|
// Populate the wave with some data
|
||||||
waveData = game.math.sinCosGenerator(32, 8, 8, 2);
|
waveData = game.math.sinCosGenerator(32, 8, 8, 2);
|
||||||
|
|
||||||
console.log(bmd.context)
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function update() {
|
function update() {
|
||||||
|
|
|
@ -6,26 +6,32 @@ function preload() {
|
||||||
}
|
}
|
||||||
|
|
||||||
var pic;
|
var pic;
|
||||||
|
var cropRect;
|
||||||
|
|
||||||
function create() {
|
function create() {
|
||||||
|
|
||||||
pic = game.add.sprite(0, 0, 'trsi');
|
pic = game.add.sprite(0, 0, 'trsi');
|
||||||
|
|
||||||
|
cropRect = {x : 0, y : 0 , width : 128, height : 128};
|
||||||
pic.cropEnabled = true;
|
|
||||||
|
|
||||||
pic.crop.width = 128;
|
|
||||||
pic.crop.height = 128;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function update() {
|
function update() {
|
||||||
|
|
||||||
pic.x = game.input.x;
|
if(game.input.x < pic.width && game.input.y < pic.height){
|
||||||
pic.y = game.input.y;
|
|
||||||
|
pic.x = game.input.x;
|
||||||
|
pic.y = game.input.y;
|
||||||
|
|
||||||
|
cropRect.x = game.input.x;
|
||||||
|
cropRect.y = game.input.y;
|
||||||
|
|
||||||
|
pic.crop(cropRect);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
pic.crop.x = game.input.x;
|
|
||||||
pic.crop.y = game.input.y;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -88,8 +88,6 @@ function render() {
|
||||||
|
|
||||||
game.debug.renderCameraInfo(game.camera, 32, 32);
|
game.debug.renderCameraInfo(game.camera, 32, 32);
|
||||||
game.debug.renderSpriteInfo(d, 32, 200);
|
game.debug.renderSpriteInfo(d, 32, 200);
|
||||||
// game.debug.renderWorldTransformInfo(d, 32, 200);
|
|
||||||
// game.debug.renderLocalTransformInfo(d, 32, 400);
|
|
||||||
game.debug.renderSpriteCorners(d, false, true);
|
game.debug.renderSpriteCorners(d, false, true);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue