AdamRyanGameDev

Members
  • Content Count

    54
  • Joined

  • Last visited

About AdamRyanGameDev

  • Rank
    Advanced Member

Recent Profile Visitors

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

  1. Found this and was curious if it-d be Phas3r or not.... unfortunately this doesn't state that it is actually Phas3r... but yeah it is! Anyways posting because there are not that many video tutorials out there
  2. Var & Let Please be aware of Var; being function scoped and for example that it can be 'hoisted'. Depending on your programming background Let; may be more intuitive for many/most situations.
  3. Thanks samme! My bad,.... seems to work fine in the labs now. Maybe I was loading too little... apologies!
  4. I am trying to implement a simple loader with scenes set up with the constructor, as so from the labs.io class MyScene extends Phaser.Scene { constructor (config) { super(config); } preload () { var progress = this.add.graphics(); this.load.on('progress', function (value) { progress.clear(); progress.fillStyle(0xffffff, 1); progress.fillRect(0, 270, 800 * value, 60); }); this.load.on('complete', function () { progress.destroy(); }); this.load.image('face', 'assets/pics/bw-face.png'); } create () { this.face = this.add.image(400, 300, 'face'); } } var config = { type: Phaser.WEBGL, width: 800, height: 600, backgroundColor: '#000000', parent: 'phaser-example', scene: MyScene }; var game = new Phaser.Game(config); Which is basically a cut and paste from the following 2 labs... http://labs.phaser.io/edit.html?src=src\scenes\scene from es6 class.js http://labs.phaser.io/edit.html?src=src\loader\load progress.js How do i get the progress bar? I know that the progress is function is called because I have console logged as it goes from 0.0 to 1.0, but I am having trouble accessing the screen in the preload, (this includes attempts to place a gif and to place text), clearly my Es6 classes knowledge is the problem here, what can i do? Where am I going wrong?
  5. Yeah I wondered the same thing and I had tried rearranging the order. It changed nothing. (that-s why I put my sprite covering half of the scroling text). Thanks @snowbillr all the same! The behaviour is a little erratic because while the text is visible when depth <=0 and not visible above depth> 0 in my example... ..however..if I make the other sprite on the screen visible=0 then the text stays visible at any depth.
  6. The plot thickens... is this a bug? I made a page exactly as follows It is basically a smaller png and bitmap text sharing a x,y and with and a log on an changing depth.. <!doctype html> <html lang="en"> <head> <meta charset="UTF-8" /> <title>My Tester</title> <script src="//cdn.jsdelivr.net/npm/phaser@3.1.1/dist/phaser.js"></script> <style type="text/css"> body { margin: 0; } </style> </head> <body> <script type="text/javascript"> var config = { type: Phaser.AUTO, width: 800, height: 600, scene: { preload: preload, create: create, update: update } }; var game = new Phaser.Game(config); var scroller; var scrollerContent = ['line1','line2','line3']; var spriteSCROLLERs1; var text0s1; function preload () { this.load.bitmapFont('desyrel', 'media/desyrel.png', 'media/desyrel.xml'); this.load.image('spriteSCROLLERs1', 'media/beigeboard.png'); } function create () { scroller = this.add.dynamicBitmapText(200, 200,'desyrel', scrollerContent, 55); scroller.setSize(200,200); scroller.depth = -2000; spriteSCROLLERs1 = this.add.image(200, 200, 'spriteSCROLLERs1'); spriteSCROLLERs1.displayWidth = 100.0; spriteSCROLLERs1.displayHeight = 100.0; spriteSCROLLERs1.setDepth = 1000; } function update (time, delta) { scroller.scrollY += 0.03 * delta; scroller.depth += 0.05 * delta; console.log(scroller.depth); if (scroller.depth > 2000) { scroller.depth = -2000; } if (scroller.scrollY > 300) { scroller.scrollY = 0; } } </script> </body> </html> What is interesting/strange is that the bitmap text is only visible with depth <=0 and that at NO point will it overlap the png. It always goes 'under' Is this desired behaviour? How do I get bitmap text visible on any thing (but the phaser container)????
  7. I am trying to debug a problem with dynamicBitmapText The code was pretty much lifted out of phaser labs.io in preload() this.load.bitmapFont('robotoBitmap', 'media/roboto.png','media/roboto.fnt'); in create() scroller = this.add.dynamicBitmapText(200, 200,'robotoBitmap', scrollerContent, 18); scroller.setSize(200,200); in update(time,delta) scroller.scrollY += 0.03 * delta; if (scroller.scrollY > 200) { console.log('called!'); scroller.scrollY = 0; } global vars var scroller; var scrollerContent = ['line1','line2','line3']; I have entered the scene it is happening and with the console (chrome) i have inspected the "var scroller." Depth, Alpha, Visible, valid xy pos, xy height all fine, the content is there and the png and fnt files are not empty! I have put a console.log in the middle of the only update loop it is calling... if (scroller.scrollY > 200) { console.log('called!'); scroller.scrollY = 0; } and the console is logging 'called' every few seconds. What/Where to do/go next? Any ideas much appreciated!
  8. UPDATE: i tried just for double sure both the following lines let timedEvent = this.time.delayedCall(3000, stopRotation, ['atlasFrame'], this); let timedEvent = this.time.delayedCall(3000, stopRotation, [atlasFrame], this); As per code in OQ, but in both cases it stops ALL rotations, not just the nameString/object passed to it... [which should be passed?]
  9. Thx Rich! I tried that in the labs but it didnt work hmmm I will have another look! Prob did something stupid! Thx again!
  10. Probably more of an issue with my js knowledge but how can I pass a parameter, for example here one of the sprites? (edited version of the lab, https://labs.phaser.io/edit.html?src=src\time\timer event.js ) function update() { atlasFrame.rotation += 0.01; singleImage.rotation += 0.01; let timedEvent = this.time.delayedCall(3000, stopRotation, [], this); } function stopRotation(spriteName){ let spriteNamehere = spriteName; window[spriteNamehere].rotation=0; }
  11. Have you considered functions that sit (globally) outside of preload/create/update? Or have i misunderstood?
  12. https://github.com/photonstorm/phaser There are the docs inside. Download and browse offline... See also this chat Mentions github and the sandbox lab
  13. I am having some problems with a game where players enter safe and danger zones... some of these areas have sprites that are angled (rotated) but appear to fire collision when the 'character' sprite collides with their total X Y rectangle space (ie minXpoint to maxXpoint, minYpoint to maxYpoint)[imagine an angled rectangle pushing out its boundaries by its 4 corners] would this be right? Or am I having other issues? TO counter act i guess I will have to create n number of collision boxes (sides parallel to X-Y axe) overlapping along angleX.
  14. Thanks! ha ha you should mention it plays audio... scared the pants off me! Anyways off to have a look.
  15. Check out this video in phaser news https://phaser.io/news/2018/03/gamefromscratch-phaser-3-video And this tutorial from phaser.io https://phaser.io/tutorials/making-your-first-phaser-3-game Good luck and enjoy!