Jump to content


  • Content Count

  • Joined

  • Last visited

Everything posted by blackhawx

  1. In the following example for labs... https://labs.phaser.io/edit.html?src=src/game objects\tilemap\collision\non-slope map and impact.js Was the csv file and all of its values manually created? or was there a tool that exported the file? Thanks!
  2. My goal within this preloading sequence is to place a Phaser graphic onto stage that increases in height as the progress gets to 100%, and at the same time, set a mask so that a background image is revealed as the the graphic height increases. I feel i'm halfway there. I'll play with that timer event to see if that helps to keep my preload up long enough before I transition to the rest of the game. Many thanks
  3. I managed to get it working on my end, but with a slightly different structure. I'm using multiple scenes, not just one, as the demo above entails. But in either case, here is whats working for me... class preloadScene extends Phaser.Scene { constructor() { super({ key: 'preLoadScene', active: true, physics: { default: 'arcade', arcade: { debug: true } }, pack: { files: [ { type: 'ima
  4. Within a scene preload function, if I have the following logic setup preload() { ... this.load.on('complete', function () { progress.destroy(); }); ... } ...Is there a way we can set a delay (3 seconds), before progress is actually destroyed? Setting `this.time.addEvent()` does not appear to work within a preload() instance.
  5. Perhaps an alternative would be to chain multiple tween sequences together with the ability of changing up the target value? (untested). In the given example, the same target is given the entire time, but perhaps it is possible... http://labs.phaser.io/edit.html?src=src/tweens\timelines\simple timeline 1.js http://labs.phaser.io/edit.html?src=src/tweens\timelines\simple timeline 7.js http://labs.phaser.io/edit.html?src=src/tweens\timelines\create timeline.js http://labs.phaser.io/edit.html?src=src/tweens\callbacks.js | an oncomplete process for a tween You could put it
  6. Yes, that's exactly what I was looking for. It's because of setCollisionByProperty. that I'm driven to now work with Tiled. Thanks for the suggestion on that!
  7. I'm giving Tiled a shot sense it appears to be a strong map driven application. Thanks!
  8. so to understand you correctly, you want to wait until an input event it triggered, (i.e. a user presses down on their mouse, then wait x number of seconds before tween begins) correct? If that was the case, this request is still easy to implement. If you look at this following example in labs: http://labs.phaser.io/edit.html?src=src/tweens\update to.js and after the paused:true, property, simply add delay:1000 and run the code. The tween won't run until the input is triggered and the delay is met.
  9. I'm looking at the following example in the labs to learn about tile collisions: http://labs.phaser.io/edit.html?src=src/game objects\tilemap\static\set colliding by property.js Based on the example, I would like to set collision properties within a JSON file, rather than depending on setting custom indexes in my game js file. Being new to this, I am attempting to use Texturepacker to create tilemaps. What would be a recommend approach in setting collision properties on tiles? (.i.e.) Do I have to edit the JSON file manually to manually put in a collision property? Is
  10. You are missing the native way to handle delays with tweens in Phaser 3. The following is a simpler and native approach to take: var config = { type: Phaser.WEBGL, width: 800, height: 600, backgroundColor: '#2d2d2d', parent: 'phaser-example', scene: { preload: preload, create: create, update: update } }; var tween; var game = new Phaser.Game(config); function preload () { this.load.image('block', 'delay/media/block.png'); } function create () { var image = this.add.image(100, 300, 'block'); tween = this.tweens.add({ targets: image, x:
  11. @kurhlaa the tween class has delay capabilities you can tap into. I would give a look over the API to see how you can naturally leverage Phaser to do related tasks. https://photonstorm.github.io/phaser3-docs/Phaser.Tweens.html https://photonstorm.github.io/phaser3-docs/Phaser.Tweens.Timeline.html And don't forget searching on Phaser labs for examples (e.g. http://labs.phaser.io/view.html?src=src/tweens\delay.js)
  12. James, if it's not too much to ask and if it works, could you demonstrate how you would use setData in one of your ''anime' scenarios? I'm curious to how we can take advantage of it relating to the topic...
  13. Your description in the process was all I needed to know. Makes perfect sense. Thanks for breaking that logic down!
  14. Hello nkholski. I love what you are doing with collisions in the game. when Mario is small and he jumps up to hit a brick, what part of the code makes the tile bump up and come back down again? Thanks
  15. With the given example from Labs, what does enableSleeping mean when it comes to matter? var config = { type: Phaser.AUTO, width: 800, height: 600, backgroundColor: '#1d1d1d', parent: 'phaser-example', physics: { default: 'matter', matter: { enableSleeping: true } }, scene: { preload: preload, create: create } };
  16. I think I solved my issue by understanding how to destroy a bob, and also learning how to use the timer event process as demonstrated here and here.
  17. Within the labs example of setting up a Blitter for fruit flying around... http://labs.phaser.io/edit.html?src=src/game objects\blitter\benchmark test 3.js I see that it runs on an update() process. But what if I wanted to destroy or remove the Blitter after 10 seconds? What would be the cleanest way of doing that in this example?
  18. I found the answer to my question by using setCollideWorldBounds(boolean); as demonstrated here.
  19. According to the official API you can set methods on tweens to do stuff. Try playing with this example //CREATE YOUR TEXT OBJECT let tconfig = { x: 200, y: 50, text: 'Skip', style: { fontSize: '24px', fontFamily: 'Arial', color: '#ffffff', align: 'center', lineSpacing: 44, } }; let text = this.make.text(tconfig); text.setWordWrapWidth(100, false); text.setScrollFactor(0); //CREATE YOUR TWEEN let mtween = this.tweens.add({ targets: your-target, x: 300, ease: 'Elastic', durat
  20. Several examples in the labs have a similar format when setting up collideWorldBounds for groups... var group = this.physics.add.group({ defaultKey: 'block', bounceX: 1, bounceY: 1, collideWorldBounds: true }); But if I wanted to change this group's collideWorldBounds value later in some random conditional statement (any kind of example will do), how would that look in code?
  21. As far as Phaser 3 goes for a background parallax effect and also being responsive, I found the following tutorial satisfying. I recommend giving it a build locally and testing it out. https://phaser.io/news/2018/04/mobile-games-tutorial
  22. I'm on Phaser 3.14 If I have the following HTML shell setup... <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title><%= htmlWebpackPlugin.options.title %></title> </head> <body> </body> </html> and within my game.js file have the following configurations setup... const config = { type: Phaser.AUTO, width: 500, height: 300, parent: 'mpha
  23. Not sure how I missed this initially, but it's clear now that I can place hexa color codes in-front of `0x` to get the tints I want. All good here.
  24. I found the answer I was looking for in setting depth to Groups. Just in case someone needs an example http://labs.phaser.io/edit.html?src=src\game objects\group\shuffle.js
  • Create New...