Search the Community

Showing results for tags 'issue'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Coding and Game Design
  • Frameworks
    • Phaser
    • Pixi.js
    • Babylon.js
    • Panda.js
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

Found 46 results

  1. For a day or two i have this weird issue that i can't fix. I am making a map with interactive trees. When i click tree i want it to change its texture to chopped trees. class Tree { constructor(sprite, deadTexture){ this.sprite = sprite; this.health = 20; this.deadTexture = deadTexture; this.sprite.interactive = true; } chop(){ console.log("chop"); this.health = 0; this.sprite.texture = this.deadTexture; } } let tree = new Tree( new PIXI.Sprite(textures.treesTexture), textures.choppedTreesTexture ); /*...*/ tree.sprite.on('click', () => { console.log("chop"); tree.sprite.texture = textures.choppedTreesTexture; }); this part works almost fine. I attached a gif that explains what is wrong. I don't know what to do and i can't find any help. What is causing such behaviour? if you need some more information about code, please let me know.
  2. Polygon collision does not work

    Hi Everyone! Hopefully someone can help with the issue I have faced. I am building a simple racing game and want to implement collision between car and other objects. I am using p2 physics. When I create primitive body objects (e.g. body.setRectangle) collision works fine, but when i use polygon (body.loadPolygon) i have created in PhysicsEditor the car just rides throw these objects without any collisions. I have tried building very simple objects to exclude "holes" in collide, creating collision groups but unfortunately any of these things helped. Attaching my code and a screenshot Car class: export default class extends Phaser.Sprite { constructor ({ game, x, y, asset }) { super(game, x, y, asset) game.physics.p2.enable(this, true) this.anchor.setTo(0.5) this.body.clearShapes() this.body.loadPolygon('physicsData', 'car') this.body.angle = -90 this.cursors = game.input.keyboard.createCursorKeys() this.velocity = 0 } Obstacle code: create () { this.game.physics.startSystem(Phaser.Physics.P2JS) this.game.physics.p2.defaultRestitution = 0.8 this.map = this.game.add.tileSprite(0, 0, 2880, 1620, 'map') this.game.world.setBounds(0, 0, 8640, 4860) this.map.scale.setTo(3, 3) this.mapAbove = this.game.add.sprite(0, 0, 'race') this.game.physics.p2.enable(this.mapAbove, true) this.mapAbove.body.clearShapes() this.mapAbove.body.loadPolygon('physicsData', 'race') this.car = new Car({ game: this.game, x: 3800, y: 3750, asset: 'car' }) this.game.add.existing(this.car) this.game.camera.follow(this.car) } Also i am using this stuff as skeleton - https://github.com/lean/phaser-es6-webpack Could troubles be in incorrect packages? Looking forward for Your reply, Thanks!
  3. I am using masks for eyes in my game. I have a black background for the eye and a white pupil. The white pupil uses the black background as a mask so that when the character blinks the pupil is hidden. The issue is that my white pupil is rendered grey (if i disable the mask the pupil is rendered white which is correct). I have looked at the alpha and it is set to 1 so it does not seem to be a transparency issue. Just wondering if anyone else has had into this issue?
  4. Hi Guys, The issue I'm having at the moment is with zooming and pinching a web page (pinching on laptops) with my game in it - causes the game to zoom in and therefore change the UI of the game. A demo can be seen here of the issue, simply zoom/scroll to see various bugs appear throughout the game once a new game has started: https://jamdonut.com/prod/0.8.2/ I can't seem to find just one solution for disabling zoom and pinch altogether on all browsers - am I missing something here? Any clues or tips, the renderer is PixiJS. Thanks, Jammy.
  5. Video won't play on Chrome Android

    Hello, I'm doing a project with Phaser (v2.7.5) and I have some issues trying to play videos with Chrome on Android (58.0). I've tried with several different tablets, it does not seem the problem is related to the device. The same code is working on desktop (Chrome & Firefox) and on Firefox Android. This is basically my code : var game = new Phaser.Game(800, 600, Phaser.AUTO, '', { preload: preload, create: create}); function preload() { game.load.video('videodemo', 'video/reward.mp4'); } function create() { var videodemo = game.add.video('videodemo'); videodemo.addToWorld(game.height/2, game.width/2, 0.5, 0.5); videodemo.play(); } I've tried the following workaround, which I found on another topic. The video plays on Android if I test the code with codepen but for some reason it doesn't if I upload it on my own server. codepen.io/junov/pen/RgrxOB Any ideas ? Thanks
  6. Hello, I'm creating a game composed by a map (created with Tiled) and, at the bottom, a menu with a list of building. The list of building is draggable horizontaly (to see all buildings). To drag all buildings at the same time I add all the buiding's sprite in a graphics component. I also put a black background with alpha to 0.25. Every component has a fixedOnCamera to true. Here is my BuildingMenu class TypeScript code: public static create(game: Phaser.Game) { let background = game.add.graphics(0, 0); background.beginFill(0x000000, 0.25); background.drawRect(0, game.height - 64, game.width , 64); background.endFill(); background.fixedToCamera = true; let buildings = ["building1", "building1"....]; let bounds = new Phaser.Rectangle(-game.width / 2, game.height - 64, game.width, 64); this.buildingsGroup = game.add.graphics(0, game.height - 64); buildings.forEach((building, index) => { let spriteBuilding = game.add.sprite(index * (64 + 2), 0, building.getName()); spriteBuilding.width = 64; spriteBuilding.height = 64; spriteBuilding.fixedToCamera = true; //this.buildingsGroup.addChild(spriteBuilding); }); this.buildingsGroup.width = game.width; this.buildingsGroup.height = 64; this.buildingsGroup.inputEnabled = true; this.buildingsGroup.input.allowHorizontalDrag = true; this.buildingsGroup.input.allowVerticalDrag = false; this.buildingsGroup.input.enableDrag(false, false, false, 100, bounds); this.buildingsGroup.fixedToCamera = true; } public static update(game: Phaser.Game) { game.camera.y += 1 } My problem is when I uncomment the line "this.buildingsGroup.addChild(spriteBuilding)" item are affected by the camera but can be dragged of course. The background is not affected.... I can't figure out why... Can anybody help?
  7. debug doesn't seem to work?

    I've recently been coding an infinite runner game in which the player is allowed to attack freely as they encounter obstacles and enemies. this being said, there is various objects that use collisions and physics bodies for collision detection and i have tried everything i have found to render the debug boxes to no avail. Attack = function() { Phaser.Sprite.call(this, game, player.x + 15, player.y, 'Attack'); game.add.existing(this); game.physics.enable(this, Phaser.Physics.ARCADE); this.animations.add('attack'); this.animations.play('attack', 8, false, true); this.body.setSize(50, 80, 30, 0); this.body.allowGravity = false; this.body.immovable = true; game.time.events.add(Phaser.Timer.SECOND * attackSpeed, setAttack, this); curAtk = this; }; //these set the variable 'Objects' Attack.prototype = Object.create(Phaser.Sprite.prototype); Attack.prototype.constructor = Enemy; //this checks conditions specific for the Attack Object made through the class every update. Attack.prototype.update = function() { this.x = player.x + 15; this.y = player.y; this.game.debug.bodyInfo(this); }; here is specifically the attacking object spawn which spawns the attack object, and on the last line of actual code i try to call the debug information to render. I'm not sure that this is the way to do it, but i have added the "render: render" to my game initialization and tried to call the code in that as well plus using the references within the examples as well and i cannot for the life of me figure out why the body's are not debugging allowing me to fine tune the desired collision areas. Any thoughts or ideas are welcome. if more code is needed of what i have i can upload my JS files. Also a quick note, there are no error messages. and everything runs as expected aside from the debugging aspect and proper hit-box areas.
  8. Help With localstorage api

    hey guys I'm currently after completing a tutorial at http://zenva.com . I have been working on my knowledge with phaser. anyways, after finishing the tutorial i decided to polish the game. I am new to the localstorage api and was looking for some help. here is my code for the highscore. it currenly doesnt work with localstorage and im not sure why. Any help is much appreciated init: function(score) { var score = score || 0; localStorage.setItem("score", this.highestScore); this.highestScore = this.highestScore = localStorage.getItem("score"); this.highestScore = Math.max(score, this.highestScore); if(this.highestScore === null) { localStorage.setItem("score", "0") this.highestScore = localStorage.getItem("score"); } }, Here is the full file. Just incase its needed var SpaceHipster = SpaceHipster || {}; //title screen SpaceHipster.MainMenu = function(){}; SpaceHipster.MainMenu.prototype = { init: function(score) { var score = score || 0; localStorage.setItem("score", this.highestScore); this.highestScore = this.highestScore = localStorage.getItem("score"); this.highestScore = Math.max(score, this.highestScore); if(this.highestScore === null) { localStorage.setItem("score", "0") this.highestScore = localStorage.getItem("score"); } }, create: function() { //show the space tile, repeated this.background = this.game.add.tileSprite(0, 0, this.game.width, this.game.height, 'space'); //give it speed in x this.background.autoScroll(0, 10); //start game text var text = "Tap to begin"; var style = { font: "30px Arial", fill: "#fff", align: "center" }; var t = this.game.add.text(this.game.width/2, this.game.height/2, text, style); t.anchor.set(0.5); //highest score text = "Highest score: "+this.highestScore; style = { font: "15px Arial", fill: "#fff", align: "center" }; var h = this.game.add.text(this.game.width/2, this.game.height/2 + 50, text, style); h.anchor.set(0.5); }, update: function() { if(this.game.input.activePointer.justPressed()) { this.game.state.start('Game'); } } };
  9. I need help. I was following a tutorial online for the Phaser States, and I did everything right (I think), but obviously, I've made some changes myself to fit to what I kind of want. Here is the code: var loadState = { preload: function() { // Load the BG Images (Before so we can have an awesome looking loading screen) game.load.image('redPlanet', '././assets/images/redplanet.png'); game.load.image('spaceBG', '././assets/images/spaceBG.png'); // Preload the one character we need to look awesome! game.load.image('scavenger', '././assets/images/Scavenger.png'); // Add the loading label and the character, so the player doesn't think the game crashed. var background = game.add.sprite(0, 0, 'spaceBG'); background.scale.setTo(0.6); var character = game.add.sprite(80, 150, 'scavenger'); var loadingLabel = game.add.text(0, 0, 'Loading...', {font: '30px Courier', fill: '#fff'}); loadingLabel.alignTo(character, Phaser.RIGHT_CENTER, 16); // Load the Planet Images game.load.image('planet1', '././assets/images/Planet1.png'); game.load.image('planet2', '././assets/images/Planet2.png'); game.load.image('planet3', '././assets/images/Planet3.png'); game.load.image('planet4', '././assets/images/Planet4.png'); game.load.image('planet5', '././assets/images/Planet5.png'); game.load.image('planet6', '././assets/images/Planet6.png'); game.load.image('planet7', '././assets/images/Planet7.png'); game.load.image('planet8', '././assets/images/Planet8.png'); game.load.image('planet9', '././assets/images/Planet9.png'); game.load.image('planet10', '././assets/images/Planet10.png'); game.load.image('planet11', '././assets/images/Planet11.png'); game.load.image('planet12', '././assets/images/Planet12.png'); game.load.image('planet13', '././assets/images/Planet13.png'); game.load.image('planet14', '././assets/images/Planet14.png'); // Load the pause button game.load.image('pauseButton', '././assets/images/pauseButton.png'); } create: function() { game.state.start('menu'); } } And that is not all. Every single one of my state files has an error that says: Expected '}' to match '{' from line 1 and instead saw 'create'. Missing Semi-Colon. Unrecoverable Syntax Error (93% Scanned) Please help me, as this was going to be the way I made my game because I really like how organized states are!
  10. Hello, I just encountered the following issue. In two different games I am using two ways of updating the game time shown in the UI - a timer and a timed event. I've just discovered that changing the PC's clock by -1 hour (say it's 10:00 AM, I roll it back to 9:00 AM) causes the updating to stop. This issue is not present if I roll the clock forward (from 10:00 AM to 11:00 AM). I found a way around this by using setInterval and clearInterval, but I'd like to know if a Phaser internal fix or workaround exists, or maybe if I need to do something differently. Here is the case when using a timer: private startTimer(): void { this.gameTime = 0; this.timer = this.game.time.create(); this.timer.loop(Phaser.Timer.SECOND, () => { this.updateTime(); }, this); this.timer.start(); }; And here is the case when using a timed event in the second game: this.timeElapsed = 0; this.game.time.events.loop(Phaser.Timer.SECOND, () => { this.updateTimer(); }, this); Both calls are made in the play state's create function. This is on a Windows 10 PC.
  11. Brick-Bricker

    Hey I am currently polishing off my Breakout or Brick-Breaker game (whichever you prefer to call it). I am trying to add music to the game when the start button is pressed and then sound effects every time a brick is destroyed. Unfortunately Phaser keeps saying Key "Sample" is not found in cache. I have tried using Phasers examples and basing the music off that but to no avail. I am new to programming with Phaser and would really appreciate the help. When the game is finished i will post a link. Thanks in Advance Pheaset here is my code var game = new Phaser.Game(480, 320, Phaser.AUTO, null, { preload: preload, create: create, update: update }); var firework;; var music = Phaser.Sound; var lives = 1; var livesText; var lifeLostText; var ball; var paddle; var bricks; var newBrick; var brickInfo; var scoreText; var score = 0; var playing = false; var startButton; function preload() { game.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL; game.scale.pageAlignHorizontally = true; game.scale.pageAlignVertically = true; game.stage.backgroundColor = '#eee'; game.load.image('ball', 'ball.png'); game.load.image('paddle','paddle.png'); game.load.image('brick', 'img/brick.png') game.load.spritesheet('ball', 'img/wobble.png', 20, 20); game.load.spritesheet('button','button.png', 120, 40); game.load.audio('Good-Riddance', 'Good-Riddance.mp3'); } function create() { game.physics.startSystem(Phaser.Physics.ARCADE); startButton = game.add.button(game.world.width*0.5, game.world.height*0.5, 'button', startGame, this, 1, 0, 2); startButton.anchor.set(0.5); music = game.add.audio('Good-Riddance') this.music = this.add.audio("Good-Riddance") this.game.sound.setDecodedCallback(["Good-Riddance"]); if(playing === true) { music.play() }else{ music.mute = false; }
  12. Cant add Child to background

    I cant figure out how i would be able to add a function as a child, the function spawns items at the top of the screen and then they fall to the bottom where they will be killed. But if i add a background the items spawn behind that background. i cant figure out how they will be able to spawn infront of the background any help would be greate! Here im trying to add the items as a child Potato.SpawnPotato = this.mainBackground.addChild(game.potato); And this is the code which holds game.potato Potato.item = { spawnPotato: function(game){ game.world.enableBody = false; game.physics.startSystem(Phaser.Physics.ARCADE) game.physics.arcade.gravity.y = 200; var dropPos = Math.floor(Math.random()*650); var dropOffSet = [-27, -36, -36, -38, -48]; var potatoType = Math.floor(Math.random()*5); var potato = game.add.sprite(dropPos, dropOffSet[potatoType], 'FallingPotato'); potato.animations.add('anim', [potatoType], 10, true); potato.animations.play('amim'); game.physics.enable(potato, Phaser.Physics.ARCADE); potato.inputEnabled = false; potato.anchor.setTo(0.5, 0.5); potato.rotateMe = (Math.random()*4)-2; game._potatoGroup.add(potato); potato.checkWorldBounds = true; potato.events.onOutOfBounds.add(this.removePotato, this) }, removePotato: function(potato){ potato.kill(); } }
  13. Hi everyone. I'm creating a game with Phaser for a University project and I'm trying to use Flaxis'plugin slick-ui in my project (https://github.com/Flaxis/slick-ui). I'm struggling since hours trying to get it to work. I initialized the variable slickUI, containing the plugin SlickUI, like this (following the code of a preview posted by Flaxis). In my script in index.html: window.onload = function(){ var game = new Phaser.Game(960, 640, Phaser.CANVAS,'', { preload: preload}); //adding slickUI plugin var slickUI; function preload() { slickUI = game.plugins.add(Phaser.Plugin.SlickUI); slickUI.load('assets/kenney/kenney.json'); //directory where I put kenney.json } //... } As I run this code I get no error in the console log. I thought that var slickUI, exactly as var game, was a global variable so I could be able to use it in any other .js file, but I guess I'm wrong. I tried to use slickUI variable in a file called MainMenu.js file (which is a game state, that is called after Boot.js and Preloader.js), to create a panel to be visible. My code is this: Game.MainMenu = function(game) //crea uno stato di Game { }; //prototype Game.MainMenu.prototype = { create:function(game){ var panel; slickUI.add(panel = new SlickUI.Element.Panel(8, 8, 150, game.height - 16)); //these two lines I took from the example on github }, //... } But when I try to use the variable I instantiated in the index file, that is slickUI, I get the error on console log that variable "slickUI is not defined". I tried to define and use that variable as "this.slickUI", "game.slickUI", "this.game.slickUI" but none of these worked. I also tried to instantiate the plugin directly in the MainMenu.js, but it didn't work either. So, my question is: how do I get to instantiate/call the global variable slickUI which contains the plugin, in order to be able to use it in every other .js file in the project? Your help would be so appreciated.
  14. Hi, I ran across an issue with the setTileIndexCallback method involving it triggerring multiple times. I have a health potion tile in my game and I would like for it to disappear when my player collides with it as well has add 1 to a variable storing the amount of health potions the player has collected. The problem is that the health potion doesn't disappear until my player's sprite actually collides with the health potion tile but the callback function triggers as long as part of my player is touching or inside the 32x32 box around the health potion, which is smaller than 32x32. Therefore, my variable the stores the amount of health potions collected increases infinitely as long as my player is in the 32x32 box but hasn't touched the health potion image. Here's my code relating to this issue: Inside the create function: var healthPotionCounter = 0; map.setTileIndexCallback(9, function(){this.collectHealthPotion(game)}, this); Inside this.collectHealthPotion(game) function: map.putTile(-1, layer1.getTileX(player.x), layer1.getTileY(player.y)); healthPotionCounter += 1; Help is much appreciated! Thank you!
  15. Hi people, I've recently just started using the Phaser framework 2 days ago and I am developing my first game, an RPG with phaser...I recently just ran into an issue in my character select state where my scope(this) becomes the window scope and does not recognize my internal functions. Any insight on my issue would be extremely helpful. thank you!!!
  16. I'm using GameMaker: Studio, and currently facing a problem with sound in Mobile Native HTML5 browser, Sound is Working in PC browsers, like FireFox, EDGE(Internet Explorer), but not working in Mobile Native Browsers, i have tested it in my Android and Windows Phone, Any help would be really Appreciated,
  17. How to export .babylon from unity steps
  18. Hello all, So I have been searching and I can't seem to figure this one out. I am trying to find out what the best way to end my game is? I can't seem to come across something such as scene.end() or something of that nature. What is the best practice for where I should put my winstate conditional in babylon.js? It seems like when I put it in my engine.runRenderLoop the game appears to freeze and I am unable to append anything to the page or break out of that runRenderLoop.
  19. I been having an issue while looping through 2 groups and got this error, what I think this means is one of the objects is undefined. Uncaught TypeError: Cannot read property 'width' of undefined This is code (which is in Typescript) that causes the error: for (var i = this.tris.children.length - 1; i >= 0; i--) { for (var s = this.squares.children.length - 1; s >= 0; s--) { if(Overlap(this.tris.children[i],this.squares.children[s])){ this.BreakTris(this.tris.children[i]); this.BreakSquare(this.squares.children[s]); } } } The error is given specifically for the Overlap function. Two loops which go through 2 groups in order to compare each sprite of both groups to each other and check for Overlap, which is as follows: function Overlap(spriteA, spriteB) { var boundsA = (spriteA instanceof Phaser.Sprite) ? spriteA.getBounds() : spriteA; var boundsB = (spriteB instanceof Phaser.Sprite) ? spriteB.getBounds() : spriteB; return Phaser.Rectangle.intersects(boundsA, boundsB); } I don't see what i'm doing wrong? Thanks for reading.
  20. I noticed that input.onUp is dispatched when the canvas event mouseout is fired. Phaser version 2.4.6. When mouseout is triggered on the canvas element, Phaser.Mouse.onMouseOut is called, which stops the mousePointer. Phaser.Pointer.stop then dispatches input.onUp. This is confusing because onUp can be dispatched even when the pointer is not actually released, but rather when the pointer simply leaves the canvas. Phaser.Pointer.Stop is also called when an active pointer leaves a touchscreen. It would make sense for onUp to be dispatched in this case because you can't tell whether the pointer was released at the edge of the screen or dragged off the screen completely. It doesn't make sense for a pointer that was never down to begin with. Thoughts? Is this an issue, or is this intentional? *Note: You can write around this strangeness without a problem. You are given the DOM event that triggered a Phaser event, so you can check to see if the event was a mouseout before taking action. I just want to make sure everything is behaving the way it should before writing around a problem. An example of a game that demonstrates this behavior. Note that the console will log the type of DOM event that triggered the onUp event. var game = new Phaser.Game(800, 600, Phaser.CANVAS, 'phaser-example', { create: create }); function create() { game.input.onUp.add(function(pointer, event) { console.log("Up!", event.type); }); }
  21. Got a game that plays sound as it should do on desktop, and iOS is pretty good too. However Chrome on Android is proving difficult. (Been testing primarily with a Galaxy S6 but the problem is common across a range of devices) The issue I am experiencing is that when the first sound tries to play there is a delay in the region of half to a whole minute before it eventually makes a noise. After the first sound plays the rest seem to work fine. We have a screen that needs user interaction to get through that is supposed to in the process unlock sound but for the purposes of this I've enabled the chrome://flags/#disable-gesture-requirement-for-media-playback so that it doesn't have any impact on the this issue. I can confirm that if I get the game to play a sound after it finishes the initial load with this flag enabled it will do so without user interaction, eventually - there is still the long delay. The game is using webAudio and sound spriting. All the sounds are added to phaser and spriting maps set up before any attempt to play sound is made. The sound file is being successfully loaded and is in ogg format to minimise decode time. If the game is left alone for a while before trying to play a sound the sound plays without delay. Does anyone recognise this problem? Any advice at trying to resolve it would be greatly appreciated.
  22. Hi guys, Help me please to improve my plugin! Codepen: http://codepen.io/jdnichollsc/pen/OVZPwx GitHub: http://jdnichollsc.github.io/Phaser-Kinetic-Scrolling-Plugin/ See the error: http://screencast.com/t/4iP2kPNJ ( "if i scroll once in the canvas, then click anywhere outside, the canvas also scroll randomly" - Wagyl ) Thanks in advance and Merry Christmas! Nicholls
  23. Hi there, i'm facing a weird problem. I'm using a sprite to display an image (1280px * 80px). The available are to show the image is shorter than image. At this point, i compute ratio between image size and area size to get the initial scale factor for sprite. When i run the game on my computer with Chrome, in "tablet mode" with a screen size of 1024*575px (same size as my samsung tablet), the image is fully displayed. I'm happy (Droopy style) When i run the game on my tablet (Samsung galaxy Tab 3 7.0), the image is a bit bigger and is not fully displayed. I log all values (elements sizes, image/area ratio) and values are identical. I don't understand why image is rendered differently with same scale value. What did i miss? Can you help me, it's driving me crazy. Thx. Gauthier.
  24. Hi friends, Please, include my pull request to solve one issue (the change is small) https://github.com/photonstorm/phaser/pull/2111 Issue: http://www.html5gamedevs.com/topic/17270-phaserscalemanagergetparentbounds-not-return-the-correct-parent-sizebounds-value/ Regards, Nicholls
  25. Hi there. Not sure if this is an issue, but, just checked on the documentation, and it does not say anything about this behaviour... I have this code, a simple code that collides two sprites: var mainState = ( function () { var preload = function () { game.load.spritesheet('cota-cola', 'assets/cota-cola.png', 16, 33); game.load.spritesheet('carousel', 'assets/baggage-carousel.png', 50, 100); } var create = function () { var block; cotacola = game.add.sprite(150,0, 'cota-cola'); game.physics.arcade.enable(cotacola); carousel = game.add.group(); for (var i=0; i<5; i++) { block = game.add.sprite(100 + i*50, 100, 'carousel'); game.physics.arcade.enable(block); block.body.immovable = true; carousel.add(block); } cotacola.body.acceleration.y = 400; } var update = function () { console.log(cotacola.body.touching.down); game.physics.arcade.collide(cotacola, carousel); }; return { preload : preload, create : create, update : update };})();var game = new Phaser.Game(500, 300, Phaser.AUTO, 'game');game.state.add('main', mainState);game.state.start('main'); if i call any member of touching before the collide function, it will always be false... var update = function () { console.log(cotacola.body.touching.down); // will always print false game.physics.arcade.collide(cotacola, carousel); };but if I call it after the collide function, it will be accurate... var update = function () { game.physics.arcade.collide(cotacola, carousel); console.log(cotacola.body.touching.down); // this works fine };In the documentation http://phaser.io/docs/2.4.3/Phaser.Physics.Arcade.Body.html#touching it does not say anything about this behaviour. But I think that if this isn't an issue, a warning about this should be documented. Should I post this as a github issue? == EDIT == I just discovered that the behaviour I want, is actually the .wasTouching var update = function () { game.physics.arcade.collide(cotacola, carousel); console.log(cotacola.body.wasTouching.down); // this works fine};This works even if I put it before the collide var update = function () { console.log(cotacola.body.wasTouching.down); // this also works fine game.physics.arcade.collide(cotacola, carousel);};It is kind of confusing, though... because, in a bigger context, i might want to see whether a sprite 'a' is touching something or not, from the update of another sprite 'b'... and if the collide function is coded on the sprite 'a', and the check is realized from the sprite 'b', then this behavior would be very confusing if you don't know which update function gets executed first.