Ansimuz

Members
  • Content Count

    28
  • Joined

  • Last visited

About Ansimuz

  • Rank
    Member

Contact Methods

  • Twitter
    ansimuz

Recent Profile Visitors

1042 profile views
  1. In phaser 2 to simulate parallax background when the camera moved I used: background.tilePosition.x = this.layer.x * -0.2; Heres the complete logic in Phaser 2 // create globalMap = game.add.tilemap("map"); globalMap.addTilesetImage("tileset"); this.layer = globalMap.createLayer("Tile Layer 1"); this.layer.resizeWorld(); background = game.add.tileSprite(0,0, gameWidth, gameHeight, "background"); background.fixedToCamera = true; // update background.tilePosition.x = this.layer.x * -0.2; How would be the best way to do it in Phaser 3? parallax_bg.tilePositionX = ?
  2. I just figure it out! I put the setTileIndexCallback outside the SlugPrototype and inside the create state. As I read here: http://www.html5gamedevs.com/topic/1471-how-to-handle-collision-between-sprite-and-tilemap/
  3. I'm trying to change the velocity of an object with a callback from "setTileIndexCallback" but with no luck. I can read its body velocity but cannot set it. Slug = function (game, x, y) { x *= 16; y *= 16; Phaser.Sprite.call(this, game, x, y, "atlas", "slug/slug-1"); this.animations.add('crawl', Phaser.Animation.generateFrameNames('slug/slug-', 1, 4, '', 0), 10, true); this.animations.play("crawl"); this.anchor.setTo(0.5); game.physics.arcade.enable(this); this.body.setSize(20, 11, 7, 10); this.body.gravity.y = 500; this.body.velocity.x = 40; this.body.bounce.x = 1; globalMap.setTileIndexCallback(3, function(){ console.log(this.body.velocity.x); this.body.velocity.y = -50; }, this); } Slug.prototype = Object.create(Phaser.Sprite.prototype); Slug.prototype.constructor = Slug;
  4. Hello World, I'm a pixel Artist and Game Designer sharing my work for the #gamedev sake. I just released a Free Public 2D Platform Pixel Art Pack for everyone. Check it out I even made an online Demo made with Phaser so you can see it in action: http://pixelgameart.org/demos/sunny-land/ Download this Pack at my site where I will be posting each month a Public Pixel Art Pack (code included): http://pixelgameart.org/web/portfolio/sunny-land/ Cheers and happy #gamedev
  5. @Imerso Thank you. I couldn't make it work, I'm really new to phaser and didn't know how to implement it. But... I found a solution rather easy. I just added a css rule to the canvas element like this: canvas { image-rendering: -moz-crisp-edges; image-rendering: -webkit-crisp-edges; image-rendering: pixelated; } Heres the original source: https://belenalbeza.com/retro-crisp-pixel-art-in-html-5-games/
  6. Hi, What's the best approach to avoid anti-alias (blurred pixels) when i scale my game? Thanks.
  7. Ohh that solved the issue. It was a logic problem after all. the game.physics.arcade.collide never executed because of the alive condition. Thanks Samme.
  8. Thanks Kseiver. Here's the url of the buggy game. http://ansimuz.com/phaser/first-game/ I cant see the issue. Seems like I'm not entering the parameters for game.physics.arcade.collide Correctly. game.physics.arcade.collide(this.player.sprite, this.layer);
  9. It doesn't throw any error. It just doesn't collide. the player goes thorugh as it there was not floor while falling.
  10. Hi, I'm learning phaser and got this issue. The collision between the player and the map is not working since I moved the player to its own file (player.js) as an object Im calling this in the update function on the play.js game.physics.arcade.collide(this.player.sprite, this.layer); I'm creating the tile map in the play.js createWorld: function () { this.map = game.add.tilemap('map'); this.map.addTilesetImage('tileset'); this.layer = this.map.createLayer('Tile Layer 1'); this.layer.resizeWorld(); this.map.setCollision(1); }, Here's the player.js file function player() { this.preload = function () { }; this.create = function () { this.sprite = game.add.sprite(game.width / 2, game.height / 2, 'atlas', 'player01'); this.sprite.anchor.setTo(0.5, 0.5); game.physics.arcade.enable(this.sprite); this.sprite.body.gravity.y = 500; this.cursor = game.input.keyboard.createCursorKeys(); }; this.update = function () { }; } Originally the collision worked well before putting the player in a different file, but I can't make the collision work now.
  11. Hey, Just released a new Pixel Art Assets Pack perfect for RPG or adventure games. It contains fully animated spritesheets and a whole Town Tile Map. Feel free to download it here: http://ansimuz.com/site/archives/752 No attribution required but appreciated it.
  12. Just released part 3 of my series on Impact: Your First HTML5 game using ImpactJS – part 3
  13. Yeah i been working fulltime on this project. Spread the word.
  14. Hey, I am sharing a pack containing spritesheets, map tiles and a few sounds. It's completely FREE under the Do what the fuck you want license. Perfect for prototyping your games. Check it out: http://ansimuz.com/site/archives/606