• Content Count

  • Joined

  • Last visited

  1. ruslanfan

    image top of rectangle

    @dude78 in my scene two rectangles at center with width = 0, and when i press arrow right or left width of particular rectangle visually increase, so the left rectangle is minus value because it's moving to left side of screen. Here it is Oh yes, my mistake, i see it now, "Should always be either zero or a positive value".
  2. ruslanfan

    image top of rectangle

    for example i can use png instead "new Phaser.Rectangle" and it looks ok, but it needs images - not ok
  3. ruslanfan

    image top of rectangle

    Hello! Dont know how to move image top of rectangle. Anyone know how to fix this? Thanks! var width = window.innerWidth; var height= window.innerHeight; var glass; var Left; var game = new Phaser.Game(window.innerWidth, window.innerHeight, Phaser.WebGL, 'phaser-example', { preload:preload, create: create, render: render, update: update }); function preload(){ game.load.image('glass','glass.png'); } function create(){ game.stage.backgroundColor = '#ffffff'; Left = new Phaser.Rectangle(width/2, 0, -100, height); glass = game.add.sprite(100,100,'glass'); leftKey = game.input.keyboard.addKey(Phaser.Keyboard.LEFT); leftKey.onDown.add(leftW, this); } function leftW(){ Left.width-=50; } function update(){ Left.width +=1; if(Left.width>-1){ Left.width=0; } } function render () { game.debug.geom(Left, '#fbc162'); }
  4. ruslanfan


    Hi everyone! in my project i want show some text for a short time and than remove it, but its not working maybe there is some other way to create text for short time? or maybe i put in wrong place if-statement? update: function() { this.rock.tilePosition.x -=0.5; -=2; game.physics.arcade.overlap(this.bird, this.gems, this.hit, null, this); if (this.bird.y<10){ var t = game.add.text(200,200,'text'); } if(this.bird.y > 20){ t.destroy(); } },