Jump to content


  • Content Count

  • Joined

  • Last visited

About NoxBrutalis

  • Rank
    Advanced Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. yeah, rotating things in tiled is a bad idea normally. As it doesn't translate very well. I had the same problem with walls in my map. I had thought i could could copy sections of my map in tiled, and rotate them for faster map making, but in phaser they came out all wrong. Instead of changing your cars origin to 0,0 to get it where you want, you should figure out the offset from it's intended position. so for example in your picture above where you didnt change the origin to 0,0 and it's in the wrong place, add half the width and half the height to the x and y positions and it should be
  2. you could also do: yourGroup.remove(object, true true); the remove has too bool params one to remove from scene, one to destroy. Glad you got it working
  3. Okay, so an additive blend mode is one where the colour that you're adding to an image is added to the existing colour, whereas a multiplicative blend multiplies it. So the problem is that your light cone is transparent, not white. if your scene had a layer of darkness separate from the lightcone image, and your lightcone image used white, then you could use additive blending and the white from your light would be added to the darkness beneath, negating it. So you light cone should be white, or a light yellow or something, surrounded by transparency. Does that make sense? here
  4. As far as I can tell, the lights aren't working in phaser 3, well, I tried to make one and it wasn't working. On a side note though, the docs only list a point light, type of light, so I don't think you would be able to have a cone/torch like you have in the pic even if it does work. I had a look because I've used glsl - open gl shader language before, and lighting is the kind of thing you can implement in shaders, but the example for the effects layer - Phaser's way into gl shader land, isn't working so it's probably best that you stick to your current approach. In regards to that, is t
  5. or this seems more proper as the ondown callbacks all say they aren't really for general purpose input. This is the other thing i mentioned, not much info there tho: https://photonstorm.github.io/phaser3-docs/Phaser.Events.EventEmitter.html#emit I think this is how you can emit custom events, but i dont know how it's set up.
  6. //put this in create this.keyBools = { up: this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.W), down: this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.S), left: this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.A), right: this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.D), shift: this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.SHIFT), pause: this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.ESC) } //in update if(this.keyBools.up.isDown) { // do the things
  7. Yeah, if you're talking about your UI elements then, use a different scene is your best bet.
  8. Last time I checked, animations remain and so when restarting scenes you often get warnings saying they're already defined. At the minute for the main file of my game, I have a separate initialise functions, that resets things manually, but I know a lot of people - including Rich, the main dev, use a separate scene for animations and various other assets. This is in part because they can use the scene as a splash screen to load things in a more seamless manner I think, but it has the added benefits, such as no warnings, and the ability to restart and swap scenes without the issues you're worri
  9. Indeed, your back end should be dealing in game abstractions rather than phaser data types etc. It would also be very bad for efficiency having those data types passed back and forth between the client, when simple numbers and strings could do. It's a lot like creating save game files and serializing data in that sense. When you save a game, you don't save all the objects and state and literally everything - you save simple data types that act as signposts for rebuilding your types/objects/state etc.
  10. Yes, you need to make a dynamic layer I believe. Dynamic layers, rather than static layers are for tile that you wish to modify during the game. here's a link to the docs on it: https://photonstorm.github.io/phaser3-docs/Phaser.Tilemaps.DynamicTilemapLayer.html
  11. It's the right one now. A mod must've moved this over into the correct place, you were in the bit where people share projects and plugins and things. What I do in my current game, is I have a seperate scene called the audio manager, that way the background music and sounds are not linked to the scenes changing during gameplay as such. Its the same concept as a preload scene. You may already know, but in phaser 3 you can have many scenes, but also ones that run at the same time.
  12. SOLVED AT LAST Im an idiot really as I think I read a post about this recently, but Im guessing a group is considered a container? I saw someone say that containers wipe set data from gameobjects when you add them to the container. This is definitely the case with group, though I'm wondering if this is expected behaviour? Im not sure as many people would spot it, as most people seem to have their players as standalone, but in my project the player is in a group with other friendly a.i sprites. So basically, if you add a sprite to a group after having set : this.player.set
  13. In the example you quoted, the name of the animation is being concatenated to the end of a user defined event. It's Samme's way of making ti so he only get's events when it's a specific animation. I didn't know you could do that actually, hence the like
  14. Just a quick update, sorry to bump, but further to the above, I realised that the built-in tilemap collider is way more efficient, ofc it only depends on the size of your map, mine is 10k tiles, so pretty big. So i counted up the collision tiles and I had 1768 collision tiles, and it was noticeable because lag. So I optimised further. I found out that using the tiled object layer, although tedious, allows for more simple data loading. I went back into my tiled map, and added another object layer for collision tiles, and instead of having one per tile, I made all the walls into long tiles etc
  • Create New...