jonteferm

Members
  • Content Count

    28
  • Joined

  • Last visited


Reputation Activity

  1. Like
    jonteferm got a reaction from Kraken in How to keep score from resetting after every level   
    Don't you have the counter as a variable global to the whole game? Where do you keep the counter? Post a code snippet
  2. Like
    jonteferm got a reaction from MysticJ in How to keep score from resetting after every level   
    Don't you have the counter as a variable global to the whole game? Where do you keep the counter? Post a code snippet
  3. Like
    jonteferm got a reaction from awbummer in "Norco: Faraway Lights" - a cyberpunk text adventure in the spirit of Snatcher   
    Cool! I played the demo and I love the style and atmosphere. Looking forward to the full game!
  4. Like
    jonteferm got a reaction from erronius in Phaser Assets Licensing   
    I don't know about the assets. I suppose it's free to use in your case but I let someone else answer that. But...
    Have you ever checked out this site? http://opengameart.org/
    You might find some really cool stuff to use. 
  5. Like
    jonteferm reacted to samme in Collision between objects in the same group does not work   
    this.game.physics.arcade.collide(this.enemies); // OR this.game.physics.arcade.collide(this.enemies, this.enemies, callback); should work but if all bodies are immovable they can't react to the collision, so you won't see anything happen.
    (Collisions against null always fail.)
  6. Like
    jonteferm reacted to FinalFantasyVII in Collision between objects in the same group does not work   
    Hi!
    Try this:
    spawnEnemies: function(map){ this.enemies = this.game.add.group(); this.game.physics.arcade.enable(this.enemies); var enemyStartPositions = this.findObjectsByType('enemyStart', this.map, 'objectLayer'); for(var i = 0; i < enemyStartPositions.length; i++){ var enemyStart = enemyStartPositions[i]; var enemy = new Enemy(this.game, enemyStart.x, enemyStart.y, 'cultist'); enemy.countStats(); this.enemies.add(enemy); } this.enemies.setAll("body.immovable", true); } this.physics.arcade.collide(this.enemies); this.physics.arcade.collide( this.player, this.enemies, this.collisionHandlerPlayerAndEnemy, null, this ); this.physics.arcade.collide( this.enemies, null, this.collisionHandlerEnemyAndEnemy, null, this ); Check your 'map' argument 'function(map)' and 'this.map'. Is 'this.map' a variable? If you want to make it a returning argument just write 'map'
    I hope it helps!
  7. Like
    jonteferm reacted to Franzeus in Phaser Tilemaps and Tiled   
    Perfect, its exactly what I wanted! Didn't really understand the objects layer in Tiled
    var Tower = function () { Phaser.Sprite.apply(this, arguments); }; Tower.prototype = Object.create(Phaser.Sprite.prototype); Tower.prototype.constructor = Tower; // Creation: this.towers_group = this.phaser.add.group(); this.towers_group.classType = Tower; this.towers_group.enableBody = true; // name, gid, key, frame, exists, autoCull, group, CustomClass, adjustY this.map.createFromObjects('Object Layer 1', 1, 'tower', 0, true, false, this.towers_group, Tower); this.towers_group.setAll('body.immovable', true); this.towers_group.setAll('body.moves', false);  
  8. Like
    jonteferm reacted to mrxj88 in no collision on top down tiled   
    Hey thanks for the reply count doom. It was the movement from using:
    if (game.input.keyboard.isDown(Phaser.Keyboard.LEFT)) { player.x -= 2; i had to change it too:
    if (cursors.left.isDown) { player.body.velocity.x = -150; I also took your advice and changed it to 3000.
    Now the collision with the tiles work perfectly. Thank you again for the reply!
  9. Like
    jonteferm got a reaction from mrxj88 in no collision on top down tiled   
    Looks like the walls is just a layer and not a group with enabled arcade physics. It will not work with the arcade.collide as it is just for stuff that have arcade physics. Have you tried to set collissionBetween to more than that? I have to set it to at least 3000 in my game for collision to take place.