• Content Count

  • Joined

  • Last visited

About Kobaltic

  • Rank
    Advanced Member
  • Birthday 12/13/1978

Contact Methods

  • Website URL
  • Skype

Profile Information

  • Gender
  • Location
    Eastern, PA, USA
  • Interests
    Game programming, Coaching Baseball and football, Texas holdem poker.
  1. Use an if statement with the direction of travel. Then enable the camera follow if it is to the right else disable the camera follow.
  2. Phaser does combine collisions into the smallest number of collisions possible. You can use object.body.setSize(width, height, x, y) to change the collision http://phaser.io/docs/2.4.4/Phaser.Physics.Arcade.Body.html#setSize
  3. First off use the code brackets when posting code. It makes it a little easier. They are the <> symbol on the toolbar. Change this: //ADDED animation to main character sprite the last number is frames per second beluga.animations.add('swim', [0, 1, 2], 10, true);//ADDED play the animation of the main character sprite beluga.animations.play('swim');To this: //ADDED animation to main character sprite beluga.animations.add('swim', [0, 1, 2]);//ADDED play the animation of the main character sprite the last number is frames per second beluga.animations.play('swim', 10, true);Or this (since you are using all the frames, you don't need to say how many there are): beluga.animations.add('swim'); Edit: You call the animation.play with the frames per second. More information here: http://phaser.io/examples/v2/animation/sprite-sheet
  4. You could go the route that you want to but it will be a performance hit. Use blender to render the still images. Use a texture packer to make a sprite sheet. (Then you have one draw call) and use Phaser's animate to cycle through the sprites. I use https://www.codeandweb.com/texturepacker It is free (there is a paid version but you don't need it just for packaging sprites). It supports smart folders which is nice. There is a bunch of tuts on how to use it. Hint just make sure your sheet is larger then the size of the tiles times the number of tiles. After you have your sheet follow this: http://phaser.io/examples/v2/animation/sprite-sheet I believe you can set a color to be transparent. Although I just pull it into Photoshop and pull out the animations and paste them on a transparent background.
  5. I am not sure if it is your problem but you want to use velocity with movement when using physics. I use maps over 1,000 X 1,000 with 4 layers and about 500 sprites on the sheet. I have a ton of collisions and I don't have a single issue, so I doubt it is Phaser's tilemaps.
  6. You have to destroy it. this.music.destroy();Here is the example for what you want. http://phaser.io/examples/v2/audio/remove-sound
  7. I am not 100% sure if this is your problem but if you look at the end of your json file it has: "image":"..\/res\/tiles.png", but you don't define the tiles.png in your code. You have basictiles.png. Also if you keep your names the same it would be a little less confusing. Example you could do this, which might have led you to missing the tiles.png: game.load.image('basictiles', '/res/basictiles.png');mainmap.addTilesetImage('basictiles');More info here : http://phaser.io/docs/2.4.4/Phaser.Tilemap.html#addTilesetImage
  8. First off you might as well add the update to : var game = new Phaser.Game(800, 600, Phaser.AUTO, 'phaser-example', { preload: preload, create: create });If you are going to do anything you will need to call the update. Also I usually add in render too. That is useful for debugging your player information. The actual problem seems to be that you aren't using CSV as the map type in Tiled. In Tiled, go to Map then map properties. Under Tile layer format select CSV. Save and try again.
  9. Texture atlas are for a sheet with sprites of different sizes. @Hadik What you have is correct for the 4X4. You just need to call the animation to play. Look up cursor keys and when you press up call player.animations.play('up'). Here is my real working code: In the create: cursors = game.input.keyboard.createCursorKeys();game.physics.enable(player, Phaser.Physics.ARCADE);In the update ( call movePlayer in the update): function movePlayer(){ /* start velocity at 0 * get movement from key pressed * move player with velocity * play correct movement animation */ player.body.velocity.x = 0; player.body.velocity.y = 0; if (cursors.right.isDown) { player.body.velocity.x = playerSpeed; player.animations.play('east'); }else if (cursors.left.isDown) { player.body.velocity.x = -playerSpeed; player.animations.play('west'); }else if (cursors.up.isDown) { player.body.velocity.y = -playerSpeed; player.animations.play('north'); }else if (cursors.down.isDown) { player.body.velocity.y = playerSpeed; player.animations.play('south'); }else { //stop the animation but keep player facing same direction player.animations.stop(); }}
  10. Any chance we could get a section on the forums dedicated to tuts and another dedicated to open source code. I have found some good code by searching but it would be nice to have a section.I think this would help out.
  11. Updated first link with the github repository. It is still a work in progress. It still stinks on mobile. I took out the sprites from the minimap as I couldn't get them to disappear when the minimap was turned off (the code is still there just commented out). I was trying to use phaser physics to handle collision by the way of the minimap but I haven't been able to get it to work. The code has little comments. I am not fully supporting this ATM but can answer some questions.
  12. I tried to change the z by sprite.z. It displays the value as being changed but it doesn't actually move the sprite's depth based on the other sprites. I want a user to hit a button and pop the sprite to the front of the screen. How can I achieve this. Thanks in advance.
  13. I prefer video tuts. 1. I love to make them. 2. you can see everything that is happening. I hate when I read a book and it says now do xyz. Then I am scratching my head going how do I do xyz. Now I have to stop the tut and google on how to do xyz. So it is nice to see everything straight through. I do like the ability to pop to page in a guide and find my exact problem as opposed to scrolling through a video. Overall I prefer videos though.
  14. Yeah I am using php in my back end. I figured I would have to go this route. Thanks.