mirror of
https://github.com/photonstorm/phaser
synced 2024-11-27 07:01:20 +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()
|
||||
{
|
||||
// game.physics.collide( sprite, otherSprite ) ;
|
||||
|
||||
// Move sprite up and down smoothly for show
|
||||
var tStep = Math.sin( counter ) ;
|
||||
|
|
|
@ -28,8 +28,6 @@ function create() {
|
|||
// Populate the wave with some data
|
||||
waveData = game.math.sinCosGenerator(32, 8, 8, 2);
|
||||
|
||||
console.log(bmd.context)
|
||||
|
||||
}
|
||||
|
||||
function update() {
|
||||
|
|
|
@ -6,26 +6,32 @@ function preload() {
|
|||
}
|
||||
|
||||
var pic;
|
||||
var cropRect;
|
||||
|
||||
function create() {
|
||||
|
||||
pic = game.add.sprite(0, 0, 'trsi');
|
||||
|
||||
|
||||
pic.cropEnabled = true;
|
||||
|
||||
pic.crop.width = 128;
|
||||
pic.crop.height = 128;
|
||||
|
||||
cropRect = {x : 0, y : 0 , width : 128, height : 128};
|
||||
}
|
||||
|
||||
function update() {
|
||||
|
||||
pic.x = game.input.x;
|
||||
pic.y = game.input.y;
|
||||
if(game.input.x < pic.width && game.input.y < pic.height){
|
||||
|
||||
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.renderSpriteInfo(d, 32, 200);
|
||||
// game.debug.renderWorldTransformInfo(d, 32, 200);
|
||||
// game.debug.renderLocalTransformInfo(d, 32, 400);
|
||||
game.debug.renderSpriteCorners(d, false, true);
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue