msanatan

Members
  • Content Count

    10
  • Joined

  • Last visited

About msanatan

  • Rank
    Member
  • Birthday 01/31/1991

Contact Methods

  • Website URL
    https://msanatan.com
  • Twitter
    marcussanatan

Profile Information

  • Gender
    Male
  • Location
    Trinidad and Tobago
  1. Simple fun, good work! Works well for your goal
  2. The switch up is a good touch. Well done!
  3. msanatan

    Phaser 3 Website

    Sounds good @selgkr. I once did an experiment with Phaser + socket.io, I think I hosted it on Heroku as it was pretty simple to update via Git. I primarily use AWS nowadays, mostly ECS. It can get expensive 😒. Hey, whatever works
  4. Hey @a.lead, I worked on a game where I took objects from Tiled and put them into sprite groups. Like you, I used the createFromObjects() function. I then looped through each object and enabled physics via the Scene object. After they were enabled, I added them to a sprite group. The code structure may not be super clear without the full context, but I figure it would still help: // This function makes a Tiled object a sprite with a physics body // We need a scene object to enable physics const createSpike = (spike, scene) => { spike.setOrigin(0.5, 0.5); scene.physics.world.enable(spike, Phaser.Physics.Arcade.DYNAMIC_BODY); spike.body.setSize(32, 30); spike.body.setImmovable(true); spike.body.setAllowGravity(false); }; // The code below was called in my create() function of my game let spikeObjects = tilemap.createFromObjects( TILED_SPIKES_LAYER, TILED_SPIKES_Key, { key: SPIKE_KEY }, this ); // If the createFromObjects method fails, it returns null // We just set it to an empty array to not deal with errors if (!spikeObjects) { spikeObjects = []; } spikeObjects.forEach((spike) => { createSpike(spike, this); }); const spikes = this.physics.add.group(spikeObjects); I get the body once I call scene.physics.world.enable() on my object. If your code is in one file, then instead of scene you can just reference this inside the create() or update() functions. Hope this helps!
  5. msanatan

    Phaser 3 Website

    Hey @selgkr, luckily (or unluckily) you got a lot of options to share your Phaser game. I had games on my website https://msanatan.com, which is hosted by GitHub Pages. It's simple as I use git extensively and free. I also created an account with https://itch.io, a great place to discover and upload indie games. However, any web hosting service will do. Netifly, S3 and maybe others host static websites for free. But I'd recommend itch.io because you'll be with a larger community of game developers.
  6. Glad you found that thread! I haven't used them myself but I figure Containers would be what you're looking for. I remember reading about them from this devlog: https://phaser.io/phaser3/devlog/120
  7. I had the same issue and posted the location of the custom properties here if anyone is still interested Note that I found it in the `data` property with the current Phaser version, 3.23. I'm not sure if it was always set in earlier iterations of Phaser 3.
  8. I should add that I got that output with Phaser version 3.23.0 (the most recent one at the time of writing). It's possible that it may not have been in the version you used at the time
  9. msanatan

    i'm confuse

    Just pitching in, a lot of HTML game frameworks are built upon technology that was introduced with HTML5. For 2D there's the Canvas API and for 3D (and also 2D) there's the WebGL API. For sound there's the Web Audio API and even one to make your game go fullscreen. I definitely say start with Phaser 3 like the others did. It's very intuitive, you'll quickly see results and have fun using it. But the tech underneath it is fairly accessible too! It's totally possible to make games with just the HTML5 APIs, although anything substantive will be lots of work. If you're curious, have a look at those too 🙂
  10. I had the same problem! So in put a console.log() for the object I loaded and saw this: The custom data from Tiled goes to your sprite's data property. You can read the docs for more info on the data management component. Hope this helps!