• Content Count

  • Joined

  • Last visited

About D3thy

  • Rank

Profile Information

  • Gender
  • Location
  1. D3thy


    Agree with Richard, change from AUTO to CANVAS, this drastically reduced stuttering in my game and im using a 8000px wide background, multiple tile map layers, animations etc etc...
  2. D3thy

    Need advice!

    If you are completely new to javascript and html5 i would suggest not using Phaser to make your game. If i am not mistaken Game maker and Construct are both very simple, easy and require little or no coding to make any games. Mind you, im sure there is limitations as a direct result of this, but at the very least it will give you an understanding of game mechanics and design. Phaser is a game engine for people who already know Javascript and have an understanding of html5, css or at the very least...know what canvas is. However, regardless...here is a decent tutorial where something similar to what you want. https://developer.mozilla.org/en-US/docs/Games/Workflows/HTML5_Gamedev_Phaser_Device_Orientation
  3. Thank you very much Heppell08
  4. I'm trying to use game.physics.arcade.distanceBetween(player, robots); to test the distance between my player and the enemy robots, if within a specific range then have the enemy shoot at the player. I have a function for the enemy to fire, i'm just not sure how to set up the code that uses distance between to check the range, and then run the enemyFire function.
  5. Like i already said in my first post "i seem to be unable to figure it out from the collision examples provided by Phaser." I have already attempted to check for collision and then run my restart function, was unable to make it work. Hence why i am providing the code used to create my objects i want to check collision on, and my restart function to make sure that isn't the problem.
  6. Dear Phaser Community, Thanks for taking the time help out. I'm currently trying to kill my player when he touches some fire. The player is just an individual sprite and the fire is my second layer from a tilemap. The idea was to check for collision and then restart game if true. What is the best method to go about doing this, i seem to be unable to figure it out from the collision examples provided by Phaser. preload: //the player game.load.spritesheet('mainCharacter', 'assets/Game-Graphics/player2.png', 25, 25); //the tilemap game.load.tilemap('map', 'assets/map.json', null, Phaser.Tilemap.TILED_JSON); //the fire game.load.image('doom-fire-tile', 'assets/Game-Graphics/doom-fire.png'); create: //the map map = game.add.tilemap('map'); //the tileset map.addTilesetImage('doom-fire', 'doom-fire-tile'); //the layer layer2 = map.createLayer('killfire') What would be the best method to check for collision between player and the fire or layer 2, and then have the game restart. I'm only using the generic game states so i thought i could just have the restart function reload the "preload state" like this, but it didn't seem to work. function restart(){ game.state.start('preload') }
  7. Thank you for clarifying that, i think i can make sense of what your saying, I will do some experimentation and should do just fine with all the instructions and examples you provided.
  8. Awesome, thanks a lot, i look forward to trying out p2 physics when i have a bit more experience. Just a general question, do you have to do anything different if using multiple tile sheets to make your map, say 1 tilesheet for each layer or multiple tilesheets to make 1 layer.
  9. Valueerror, Thank you so much for that contribution, i have pretty subpar javascript knowledge and i was able to understand the code and your explinations much better than any of the examples or Documentation i have seen. I hope anyone else new to the scene and looking for imformation, comes across this thread and is able to benifit from your generosity. I wish the Phaser examples had comments like your code, would make using Phaser a lot easier and more user friendly.
  10. Valueerror, thank you for verifying that...i think an explination of some things would be a hugeeee help to me and the community. What would be ideal is to take some code, like this example here, taken from the "Mario" example on phaser(i took out the unrelated code). Then explain in full detail what each part of the neccesary code is doing. I will add my own comment to give you an idea of what i mean. var game = new Phaser.Game(800, 600, Phaser.AUTO, 'phaser-example', { preload: preload, create: create, update: update }); //This code is creating your Phaser game, with the aspect ratio of 800 by 600, setting it to run on auto(which means it will run webgl or canvas, depending on the device), and then...etc etc etc function preload() { //your preload function, this function runs first and loads all of your games objects(sprites and stuff) before the game starts. game.load.tilemap('mario', 'assets/tilemaps/maps/super_mario.json', null, Phaser.Tilemap.TILED_JSON); //this is the first neccesary step to using a tilemap from Tiled, you need to load it into the game by saying game.load.tilemap and then....etc etc etc game.load.image('tiles', 'assets/tilemaps/tiles/super_mario.png'); game.load.image('player', 'assets/sprites/phaser-dude.png'); } var map; var layer; var p; var cursors; function create() { map = game.add.tilemap('mario'); map.addTilesetImage('SuperMarioBros-World1-1', 'tiles'); layer = map.createLayer('World1'); layer.resizeWorld(); //this will resize the world to match your tilemaps size?? i think }
  11. They also appear to be something that is well documented in the examples but poorly explained, relative to Phaser. I spent at least 20 hours researching on it, and ended up just getting someone else to set it up for me and then toying with it to get a better understanding. Even now, i barely know what is going on...lol
  12. So you have a sprite, which is a picture, and you want to show just the object/character, without any background? Sounds to me like you are using a .jpg or other type of picture that does not have an Alpha Channel(transparency).
  13. Yes thank you for this link, i have already gone over that tutorial before. The problem with it, is that it does not explain how exported Tiled maps are properly integrated into Phaser. You make the map in Tiled, not the game. By Physics objects, im going to assume that you mean, objects that you are able to apply collision to...in which case, from my understanding, you can only have it enabled on 1 of your Tiled maps, layers. For example, i created a map in Tiled. The map is made by using 4 layers, only 1 of these layers should have your objects that require Physics or Collision. From what i have read, posted by other users, is that there is a direct link between having more tiles/layers and a reduction in performance. However, i believe the limitation of 1 layer only being able to use Physics is a limitation of Phaser, and not Tiled. I am very new at all of this myself and my information could be wrong or misleading, please verify with a second source because you take anything to heart, i am just trying my best to shed some light for you guys.
  14. Update, using background image instead of second layer from Tiled, much easier to work with....problem avoided.
  15. Update: Was able to get tiled map to work, and the "grid" to display, that shows your world size. New problem: Second layer from tiled map is not displaying properly. Attached is picture of how the tilemap should look, how it looks now and my source code.