Mariusz

Members
  • Content Count

    23
  • Joined

  • Last visited

Everything posted by Mariusz

  1. In your code, you declare your variable score implicitly, which makes it a global variable. Because you don't reset that variable back to zero in the create() function of the play state, it goes straight into the complete state.
  2. I had the same exact problem. In my game, I have different music tracks for the MENU and PLAY states. Because it takes quite a while to decode the audio files, the track that should have been playing in the MENU state was delayed and thus played in the PLAY state alongside a different track, it was a big mess. I think that making the player wait another 30 seconds or so just for the audio files to decode is a very bad idea. Therefore I attach a handler to the onDecoded event to stop the track IF the track I want playing is not decoded yet and the state is already changing. It works well, even if it's a bit hacky.
  3. I used CocoonJS to deploy my game on Google Play. For games you're generally advised to use their accelerated canvas implementation for better performance, but there are some things you need to watch out for (some are outlined here: http://likeadev.com/show/6-tips-to-make-your-phaser-game-work-with-cocoonjs.html, might be slightly outdated). I've recently published a fairly dynamic game using phaser and cocoonjs, if you want to see what the performance is on a device running android then have a look, it's in the game showcase thread.
  4. Thanks I think an update is in order as I've received some comments regarding that very issue.
  5. @patmood Thanks! It's really inputs like yours that motivate me I was slightly worried about performance on different devices, but I haven't had any complaints so far, so that's awesome. As to the ad banners, it took me some time to set it all up properly as I hadn't done it before (mopub/admob accounts). Then at some point it seemed as if the ads stopped showing for a while, but that fixed itself soon after.
  6. I'd posted in the Phaser subforum and I thought posting here would also be a good idea. I have recently finished polishing my game called 'Alien Run for the Moon!' using the latest Phaser version (2.1.3) and CocoonJS (2.1). I published the game on Google Play earlier today. Altogether the game took a good chunk of my free time to finish. I only tested the game on my Nexus 5 and it works rather well, but that's just one fairly high-end smartphone. The game itself is about an alien that's stranded on an asteroid that you're supposed to fly back to the moon by collecting crystals and avoiding obstacles such as bombs and asteroids. As a bonus, there are 26 parts of a spaceship that the player can occasionally spot and collect. I did this as I wanted to provide the feeling that there is a long term goal to playing this game. I think overall the game offers a nice experience, although I'd love any feedback. I don't even know how to market this and if it's worthy of any marketing whatsoever. You can download the game here: https://play.google....logic.tothemoon ... aaaand you can play the game here (try playing on your phone, I made use of gyro.js so you can control the alien through the accelerometer): http://oddlogic.co.uk/alien-run-for-the-moon/index.html Literally all feedback is welcome!
  7. I have recently finished polishing my game called 'Alien Run for the Moon!' using the latest Phaser version (2.1.3) and CocoonJS (2.1). I published the game on Google Play earlier today. Altogether the game took a good chunk of my free time to finish. I only tested the game on my Nexus 5 and it works rather well, but that's just one fairly high-end smartphone. The game itself is about an alien that's stranded on an asteroid that you're supposed to fly back to the moon by collecting crystals and avoiding obstacles such as bombs and asteroids. As a bonus, there are 26 parts of a spaceship that the player can occasionally spot and collect. I did this as I wanted to provide the feeling that there is a long term goal to playing this game. I think overall the game offers a nice experience, although I'd love any feedback. I don't even know how to market this and if it's worthy of any marketing whatsoever. You can download the game here: https://play.google.com/store/apps/details?id=uk.co.oddlogic.tothemoon Literally all feedback is welcome!
  8. I've just realized that the newest CocoonJS launcher that I had downloaded from Google Play recently gave me the same black screen when I tried to run my game. I can run the game in a compiled launcher for my project though.
  9. Do you get any errors in cocoonjs console?
  10. Hey Rudy, thanks for the response. What I want to be able to do is enable the user to start drawing a line upon left mouse button click and keep manipulating the shape until the button is released. Once the user is happy with the length and angle, they will release the button and, at that point, I want to assign a physics body to the object that will acquire all the aforementioned properties, i.e. the length and the angle. So yes, to address your question, the order is crucial in this case. Unless there is a better way to approach this problem? Edit: My bad. I actually put some thought into Rudy's idea and it works perfectly fine. The sprite is manipulated and upon click release, I store the desired rotation, reset the sprite's rotation to zero and then apply it using sprite.body.angle.
  11. Hello there. I've been playing with the P2 physics engine and I hit a brick wall. If I try to enable P2 body on a sprite that is already rotated, the physics body will create a body rectangle that matches the sprite's rotation AND set the sprite's rotation to 0. I made the following gif to illustrate the issue: http://www.gfycat.com/AdolescentBruisedCuscus The scale of the dynamically created sprite seems to be preserved perfectly fine, it's just the rotation that's been baffling me. I looked briefly into phaser.js, but couldn't pin it down... Could somebody explain to me what's going on? Thanks in advance Mariusz
  12. Hi there. Have you looked into cocoonjs? There is a fair bit of information and even examples available on this forum, do a search and see if you can find what you need.
  13. Well, I think your question is semantically unclear. My gut is telling me that what you are asking about is whether a player on a different computer can join in a game made with phaser and socket.io and whether that player's camera can focus on a different point in the game world than another player's. If this is the case, then the answer would be yes, absolutely.
  14. Hello guys. I'm trying to create an explosion effect in my game and the following is my approach to the problem. The explosion consists of one explosion particle, several smoke particles and some sparkle particles. Thus I'm thinking of having three emitters. So good so far. However, I'd like the particles to animate in some ways, e.g. diminish and fade out smoothly rather than having them disappear after a certain interval. I've looked into Phaser and tried to set my custom sprite class to the particleClass property in the Emitter function, to no avail. Iterating over the group and setting a tween to each child doesn't seem like an option, since that would interfere with other particles emitted in another place in the game. What's the 'proper' approach to the problem? Thanks in advance. Mariusz
  15. Glad you figured it out, though to not make this thread completely redundant and a waste of space, perhaps you could post your solution as well?
  16. I'd also like to know the answer to the question above.
  17. Thanks for the reply, as I said it was just something I'd noticed. The main problem I still have is related to bitmapText and camera, regardless of phaser version.
  18. Hi, I'm working on a simple game and have a remark and a question. 1. I have downloaded the phaser 1.1.4 from the dev branch to see if it would work, though I know it's still under development, I can see already that sprite jitter upon rapid movement is significantly bigger than it is with the 1.1.3 release. This is more of a remark rather than a question as I don't expect you to know why that would be. I thought I'd mention it anyway. 2. I'm trying to display score in my game using the bitmapText function, though I can't figure out how to make the text fixed to camera and I haven't seen a single example that would have it implemented. I have tried setting the fixedToCamera flag. This is party the reason why I downloaded the 1.1.4 version, to see if it would work then, but it still didn't. Any help would be greatly appreciated.
  19. The things I was doing yesterday to achieve the same effect.. Thanks Rich, you're doing an awesome job.
  20. Thanks. That's what I've been trying to do, but the best I get is just one layer being rendered. function preload() { game.load.tilemap('level1', 'assets/map_default.json', null, Phaser.Tilemap.TILED_JSON); game.load.tileset('tiles1', 'assets/tileset1.png', 32, 32); game.load.tileset('tiles2', 'assets/tileset2.png', 32, 32);}var map;var tileset1;var tileset2;var layer;var layer2;function create() { map = game.add.tilemap('level1'); tileset1 = game.add.tileset('tiles1'); tileset2 = game.add.tileset('tiles2'); layer = game.add.tilemapLayer(0, 0, 800, 600, tileset1, map, 0); layer2 = game.add.tilemapLayer(0, 0, 800, 600, tileset2, map, 1); // Tried different values for the last parameter in the function above, no dice layer.resizeWorld(); layer2.resizeWorld();}Does the code above seem right? It only renders the first layer. Using two tilemaps with one layer each worked fine, at the cost of convenience... I'm hoping you'll get around to making an example of this being done properly fairly soon. Best regards Mariusz
  21. Hello. I've been trying to create some levels for my game and I found that the only way for it to work, given my tilesets, would be to create multilayered tilemaps. The problem is I don't know how to load them using Phaser functions and I've been unable to find any existing examples of this in action. Any help would be greatly appreciated. Best regards! Mariusz
  22. Hey there. I'm fairly new to making games, let alone making them using Phaser.js. Sorry if this question is outright stupid or silly for one reason or another, I really don't know much so I thought I'd ask here. I have recently started playing with Node and socket.io and it got me thinking.. how would I go about combining this and Phaser.js? Is there a particular set of steps that I have to undertake in order to make this work? At the moment I'd like to just have a sprite rendered using Phaser on each client and give them an ability to connect to each other (sort of like in this example, which I was using to teach myself the basics btw.). Again, sorry if it's a silly question, I haven't been doing this all for very long. Best regards and keep up the great work! Mariusz