• Content Count

  • Joined

  • Last visited

About vcarluer

  • Rank

Contact Methods

  • Website URL
  • Twitter

Profile Information

  • Gender
    Not Telling
  1. After reading some phaser source code I think states must set their references to game objects to null in shutdown function. I don't see how this objects can be garbage collected otherwise. Phaser Game object holds a reference on StateManager object which references all state objects in its states array. If one state object references a new sprite object for instance with the code above (which is a code I have seen in many examples), the following line must be set in shutdown I think: this.ground = null;Or maybe I've missed something? Next time the state will be set active by State Manager, the state will replace its references (this.ground) to a newly created object. So old references will then be collected by garbage collector. But in the mean time the objects cannot be released. It can be a problem too for a state which can never be reached again for example. And it's a bigger problem for quite huge object created like this. So their won't be any memory leak if object references are not set to null but too much memory is used which can sometimes be an issue. A good practice would be to set to null 'big' objects referenced by states in shutdown. Does someone which knows the framework better than me can confirm this?
  2. Thanks for your answers. And the state object is destroyed too? So the reference to objects are garbage collected? This is for this case: this.ground =, 756, 640, 213, 'ground')the state holds a reference to the tileSprite with this.ground.
  3. I am trying to find what to destroy in shutdown method of states to keep browser memory clean. I have read some posts on this question but I'm not sure to fully understand. By the same time I try to fully understand the GameObjectFactory. Can someone confirm me than calling in a state this.add is the same than calling this.add is only an alias to Or not... In a state, when I add a new object like a sprite and I affect it to, this object will be available in all states? =, 756, 640, 213, 'ground');Or Phaser destroys all added game objects between states? If I can use in all states, I certainly have to manually destroy it when needed by calling:; = null;If instead I affect this sprite to the current state what do I have to do? this.ground =, 756, 640, 213, 'ground')* Destroy it in the state's shutdown function? * Nothing: Phaser will destroy it? Phaser destroys all objects added to game with If it's not clear I plan to add all new objects to local state object and clean them all in shutdown function to be sure but it is a painful work.
  4. Yes of course. I am trying to make a template for simple HTML5 games. It's not finished at all but you will find this working part in it. There is still a lot of magic number in the code. The source code: Live example: In Android Chrome: It fits below the address bar, no page scroll, some bottom of the game screen is lost. In Android Firefox: It does not fit directly on screen, it fits without the address bar, so it may cause problem with gesture because page can be scroll down In Safari IPhone 4 & 5: It fits perfectly below the address bar (I've not done a lot of tests with it, have to buy one...). No page scroll, none of the game screen is lost I think. You can rotate the phone in portrait mode before or after the game loading. When you come back to portrait mode it fits the same way it was (this was what I tried to achieved first). Tell me if you find bugs, I'm chasing them for now. This coding part is painful and it does not generates a lot of code, but it's important to find the right match!
  5. OK I managed to make it works on Android + IPhone with device orientation check. I don't use startFullScreen anymore, after a lot of trials, the following code works quite well (some pixels can be lost at the bottom so I manage it in game design) : create: function () { this.input.maxPointers = 1; this.stage.disableVisibilityChange = true; BasicGame.orientated = true; this.scale.scaleMode = Phaser.ScaleManager.EXACT_FIT; this.scale.minWidth = / 2; this.scale.minHeight = / 2; this.scale.pageAlignHorizontally = true; this.scale.pageAlignVertically = true; if ( { this.scale.maxWidth =; this.scale.maxHeight =; this.scale.setScreenSize(true); } else { this.scale.maxWidth = * 2.5; this.scale.maxHeight = * 2.5; this.scale.forceOrientation(false, true); this.scale.hasResized.add(this.gameResized, this); this.scale.enterIncorrectOrientation.add(this.enterIncorrectOrientation, this); this.scale.leaveIncorrectOrientation.add(this.leaveIncorrectOrientation, this); this.scale.setScreenSize(true); } this.state.start('CheckOrientation'); },Device orientation hint is handled as in Phaser full screen template project with an hidden div. <body> <div id="game"></div> <div id="orientation"></div>enterIncorrectOrientation: function () { BasicGame.orientated = false; document.getElementById('orientation').style.display = 'block'; }, leaveIncorrectOrientation: function () { BasicGame.orientated = true; document.getElementById('orientation').style.display = 'none'; this.scale.setScreenSize(true); }I call again setScreenSizeTrue in leaveIncorrectOrientation, which is not done in phaser template I think. I hope this will help some people with the same issues.
  6. The game Glitch gave all its assets to public domain, must be vector but not sure: Certainly something nice to do with this.
  7. Yes this is it. it does not work anymore the way it is handled in It uses an hidden div with id "orientation" with this image in background: this div is shown when the orientation is not the good one (css display = block). I have idea how to make it works (with a sprite in the main game div) but I don't know if I need to do it + fullscreen (real one with a call to this.scale.startFullScreen()) does not work immediatly, a button must be clicked and I don't like it very much. I would have prefer to make work the same mechanism as in the template project but I can't make it work with chrome on Android: navigation bar does not hide.
  8. Hi, I'm trying to have an application template which handle properly device orientation and fullscreen. I've started with the project template in phaser : The problem is that it does not work (anymore?) with chrome on Android device: navigation bar is always shown. It works with firefox on Android. So my idea was to use the full screen mode. It can only be triggered with an user action so I've plugged it on the game start button, so the game is not fullscreen from start. And with the fullscreen mode, the device orientation recognition with the hidden div telling to rotate the device does not work anymore. My question is : what do you use to do this? Fullscreen at some point in the game + working device rotation recoginition OR you don't bother with this, it's OK to have the navigation bar on chrome... OR other?
  9. Just a quick thought maybe it's not a good solution. I do not know the framework you talk about. They seam to works well for what you try to do, I give you here an other way to look at your problem. What I would do is divide the track in cells / tiles and I won't use a path but key target cells (after each corner). After that in code I would create a subset of track's cells as a bounding box between car and next track target cell (var to keep for each car). You add other cars in this subset too as walls. Then you resolve this with a A* for the car to go to target cell. You do that for each car in a regular basis and/or event based (contact / target cell region reached). There is of course certainly more complex and accurate solutions with dynamic pathfinding. There are special case (no solution for instance) which must be handled and can be tricky. I hope it will help you.
  10. If you are targeting Android devices and experienced performance issues with it, there is a plugin here for a fast canvas with phonegap: I didn't try it and it involves some code refactoring I think.
  11. Thank you for your answer. 1 - You are right, mobile performance was one of the possible issue I had question on. 2 - Does not know pixi.js will look at. 3 - Sound system on HTML5 is quite a problem for all framework I think but there is maybe more tooling with pure js libs. 4 - I read you got non obfuscated code when in debug in GMS? In this case it must be backup for later use without GMS to avoid problems. 5 - I would buy other export module only if needed but in fact I think it's maybe over thinking, new platform will certainly means new coding (especially if first one was dedicated to HTML5)
  12. Thank you for this article, the overcrowded market part and marketing strategy cost ($500+ / month / game) is what I've experienced so far on google Play. I hope the second part on HTML5 game market opportunity will be what I will experience next ^^
  13. Hello, I have some questions about which tool to use to create HTML5 effectilvely, which means to produce a finished game as quick as possible. I'm an experienced developer, I know HTML5, canvas and I tried once phaser.js to make a game for the previous ludum dare ( My brother recently gave me a license to Game Maker Studio, which I've been trying a long time ago, and it's quite nice to make something quick. But I think (not really sure for now...) I will try to take on the HTML5 market, GMS sells a license to export at $99. At first I planed to go with GMS, despite the fact i'm a good programmer, for 2 mains reasons: - Quick to develop a new game - Can export to other technologies to try other existing markets or export games to future ones. I've read some thread on this forum which said than GMS is a little buggy and than HTML5 export needs to dedicate game project for this export kind (due to technology specific issues). I didn't got really serious on GMS, only watch some hours of video tutorials and code a little Windows game to try. I love technology but I want to make game and I try this time to use the best tool to quickly make some instead of having fun with techs stuffs. But when I see what I can achieved with something like phaser.js versus learning time of GMS + specific coding for HTML 5, the only benefit I see is quick making of games but I know I can achieved this with a proper build process and templates... So, this is where I am for now but I'm not sure of it, maybe there is other alternatives too. Do you think it's better in my context to do HTML5 directly (with phaser.js for example) or to use a high level game designer tool? Thanks.
  14. Hi, I've successfully used for non based canvas HTML 5 application, but after some research I've no doubt it should word correctly with canvas.