• Content count

  • Joined

  • Last visited

About polansk1

  • Rank

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. polansk1

    Help with Responsive

    How can i make my game responsive? i have a canvas of 800x520
  2. polansk1

    Turn code. Help

    I found that code but it's in Phaser2 and don't know what i have to change to work in Phaser3... if anyone can help me it's really important for my game! this.marker.x = this.math.snapToFloor(Math.floor(this.car.x), 32) / 32; this.marker.y = this.math.snapToFloor(Math.floor(this.car.y), 32) / 32; var i = this.layer.index; var x = this.marker.x; var y = this.marker.y; this.directions[Phaser.LEFT] = this.map.getTileLeft(i, x, y); this.directions[Phaser.RIGHT] = this.map.getTileRight(i, x, y); this.directions[Phaser.UP] = this.map.getTileAbove(i, x, y); this.directions[Phaser.DOWN] = this.map.getTileBelow(i, x, y); if (this.current === this.opposites[turnTo]) { this.move(turnTo); } else { this.turning = turnTo; this.turnPoint.x = (this.marker.x * this.gridsize) + (this.gridsize / 2); this.turnPoint.y = (this.marker.y * this.gridsize) + (this.gridsize / 2); } this.math.fuzzyEqual(a, b, threshold) this.car.x = this.turnPoint.x; this.car.y = this.turnPoint.y; this.car.body.reset(this.turnPoint.x, this.turnPoint.y); this.move(this.turning); this.turning = Phaser.NONE;
  3. polansk1

    Restarting Scene Problem

    Ok, i forgot to turn my variable gameOver to "false" that was the problem my update is under that conditional. srry hahah aand thank you!! LET'S GO!
  4. polansk1

    Restarting Scene Problem

    happen the same :S it's like not reading the update
  5. polansk1

    Restarting Scene Problem

    Hi guys! I have a problem with my restart function. Can't move my player after trigger him. In my restart button i call that function: function restartGame (){ game.scene.start('level1') juego2.scene.switch('level1') } Switch from my Game over menu to inicial scene well, but then can't move :S Console alert: Invalid Animation Key, or Key already in use: down. Any idea?
  6. polansk1

    Can PathFollower have Physics?

    Thank man!! I love you!!
  7. polansk1

    Can PathFollower have Physics?

    Hi, i have a sprite in a path and i will give him physics to make overlap or collison things, it's posible? if not, any alternative? spider = this.add.follower(path, 580, 280, 'spider');
  8. polansk1

    Turn Marker

    Hi, i found that tutorial: https://phaser.io/tutorials/coding-tips-005 but it's in phaser2 I will know how to set the part of "Turn Marker" to turn effectively checking surronding tiles.
  9. polansk1

    Mask following player

    Ty man! i found it at end : preload: this.load.image('mask', 'img/mask1.png'); create: spotlight = this.make.sprite({ x: 400, y: 300, key: 'mask', add: false }); background.mask = new Phaser.Display.Masks.BitmapMask(this, spotlight); update: spotlight.x = player.x; spotlight.y = player.y; The problem with that is i have to apply the mask to all layers, if i only apply to one layer i see the other objects on top of the mask. If anyone know another way to apply the mask to all canvas at same time i will appreciate it but at the moment that it's ok im happy!
  10. polansk1

    Mask following player

    dont know how to define mask :S I have a background (fondo) and a sprite (player). How i set the mask covering all background except player? I'm newbie in phaser sorry and it's difficult to learn for me because i dont have too many documentation for phaser3...
  11. polansk1

    Mask following player

    Hi again! i will make a mask covering all canvas but my player, making a circle around him. And i will that circle follow the player all time. I found that code but i think its not working because it's Phaser2. How can i do that? mask = game.add.graphics(0, 0); mask.beginFill(0xffffff); mask.drawCircle(100, 100, 100); fondo.mask = mask; fondo.mask = mask;
  12. polansk1

    Collision between my Tileset and the Player

    ty man!! i got it! function create(){ //platform this.map = this.add.tilemap('level1'); var tileset = this.map.addTilesetImage('tileset_sprite','gameTiles'); walls = this.map.createStaticLayer('walls', tileset,0,0); //player player = this.physics.add.sprite(40, 40,'dude'); walls.setCollisionBetween(1, 50); this.physics.add.collider(player, walls); //movimiento cursors = this.input.keyboard.createCursorKeys(); } working
  13. polansk1

    Collision between my Tileset and the Player

    Ok, so what variable i have to put instead tileset? i try it with this.walls and walls=this.walls but it's not working..
  14. Hi! i need help! I have a tileset like a labyrinth and i will know how to set collisions between my Players and the walls of labyrinth(tileset). That's my actual code. All is working except that line: >>this.physics.world.collide( player, tileset ,null, this);<< What im doing wrong? function preload () { this.load.image('gameTiles', 'img/tileset_sprite.png'); this.load.tilemapTiledJSON('level1', 'maps/tileset_walls.json'); this.load.image('dude', 'img/dude.png'); } function create () { // platform............. this.map = this.add.tilemap('level1'); var tileset = this.map.addTilesetImage('tileset_sprite', 'gameTiles'); this.walls = this.map.createStaticLayer('walls', tileset); // player.............. player = this.physics.add.sprite(40, 40, 'dude'); // collisions........... this.physics.world.collide(player, tileset, null, this); player.setCollideWorldBounds(true); }