Jump to content

Collision bug (?)


lequ
 Share

Recommended Posts

Hey!

 

I've done the pacman tutorial with my own maps and for some reason do I get a collision where I'm not suppose to. If I move in a specific patern I get a collision on the safetile. There is a safetile to the right, but I can't go there. If I move up and back down I can move to the tile, but if I do a fixed pattern I can't move to it. Do anyone have any ideas? I've looked around for a solution and I found this thread:

 

http://www.html5gamedevs.com/topic/15363-collision-bug-collision-happening-randomely/

 

It didn't get alot of attention, is there no other solution for this, have I done something wrong?

 

Thanks in advance, love the work you guys do! :D

 

 

create: function() {
        
        this.map = this.add.tilemap('map');
        this.map.addTilesetImage('sourceimage', 'tiles');
        
        this.layer = this.map.createLayer('lvlonelayer');
 
        this.map.setCollisionByExclusion([this.safetile], true, this.layer);
        
        this.char = this.add.sprite(30, 0, 'char');
 
        this.physics.arcade.enable([this.char]);
        this.char.body.collideWorldBounds = true;
 
        this.cursors = this.input.keyboard.createCursorKeys();
        
    },    
 
update: function(){
 
        this.physics.arcade.collide(this.char, this.layer);
        
        this.checkKeys();
    }
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...