casey

Members
  • Content Count

    94
  • Joined

  • Last visited


Reputation Activity

  1. Thanks
    casey got a reaction from Vinnyreis in I need a REAL book to learn and study the phaser2   
    I don't think you'll find a physical book, only e-books because frameworks change so quickly that once it's printed it's out of date. E-books can be updated by the authors more easily. 
    But if you want a hard copy, buy an e-book and print it.
    I second Feronato's site and books. You can find tutorials on different HTML5 frameworks available there. 
  2. Like
    casey reacted to nrbdch in Tipping/slide effect: gravity doesn't work   
    Arcade Physics is a system based on AABB collision detection, every sprite has a rectangular body shape and it's not possible to rotate it. You can observe that with render function below. For more advanced physics like slopes, you could use P2 Physics. 
    function render() { game.debug.body(ledge); }  
  3. Like
    casey got a reaction from cpu_sam in How to load file fonts from format fnt?   
    Full tutorial here: https://www.joshmorony.com/adding-custom-fonts-to-your-phaser-game/
  4. Like
    casey got a reaction from samme in Drag and drop image   
    https://codepen.io/jdnichollsc/pen/WbZgwM
    https://phaser.io/examples/v2/input/drag-event-parameters
     
  5. Thanks
    casey reacted to samme in 2D array: swapping texture of particular picked item   
    The picked tile texture key would be 
    e.texture.key If you need to track all of them, you make store a second "grid":
    { create: function () { // ... this.objGrid = []; var i, j; for (i = 0; i < rows; i++) { // ... this.objGrid.push([]); for (j = 0; j < cols; j++) { // ... this.objGrid[i].push(0); // ... } } }, addTile: function (row, col) { // ... this.objGrid[col][row] = this.myTile; } }  
  6. Like
    casey reacted to PsichiX in Is there any way to detect if sprite is a circle?   
    it will be a most width^height times faster to manually specify it in variable.
  7. Thanks
    casey reacted to onlycape in animation doesn't loop   
    Hi @casey,
    Replace this line:
    this.animat.play('swing', 20, true); with this:
    this.animat.play(20, true); Regards.
  8. Like
    casey reacted to fariazz in Tutorial - How to make a game in Phaser 3   
    Hi everyone, just wanted to share my tutorial on how to make a simple frogger-style game in Phaser 3 (including some camera shake and fadeout effect)
    Hope you like it!
    How to make a game in Phaser 3
  9. Thanks
    casey reacted to rich in tutorial question: when to create variable   
    If you forget to declare it, it just becomes a globally scoped var. which is why it works either way (in this tutorial)
  10. Like
    casey got a reaction from Hemanthraj in Phaser Code standard   
    What do you mean by code standard? You can download the JS files from the Phaser page. http://phaser.io/download
  11. Like
    casey reacted to Kai23 in Make update loop in sync with music and notes in Phaser   
    finally, the solution was to do something like this : 
    var notes = [ ... {'start': 1377, 'jam': 1, 'duration': 0.40}, {'start': 2456, 'jam': 1, 'duration': 0.30}, ... ]; // Index of the first note that will be played. // Will be incremented by 1 or more with some update() calls, // depending on the time that passed. var nextNote = 0; function update() { // Process all notes that are now in the past // compared to the current time of the playing music, // but skip notes that have been already played before. while (music && nextNote < notes.length && notes[nextNote].start <= music.currentTime) { console.log(notes[nextNote]); nextNote += 1; } }  
  12. Like
    casey reacted to nkholski in Generic platformer + ES6 / Webpack 4 boilerplate   
    This project started off as a Phaser 3 / ES6 / Webpack boilerplate for testing Phaser 3 in its early stages, but ended up with a quite ambitious demo attached to it. I kept updating it and now it has two purposes:
    1. A Phaser 3 / ES6 / Webpack 4 boilerplate. Replace the src folder with your own game and you have a good foundation watching your scripts and a built-in server with live reload plus the possibility to deploy your code for production use.
    2. A,  let's call it "generic platformer". Hack around in the source to see what's making the demo tick or alter it to build something of your own. The code isn't as tidy as it should be, and some parts are still left since the beta when I had to do hacks around the API to get things running but I'm making an effort now and then to improve it. Also, when I feel for it I add an extra feature. I prioritize features that force me to explore new parts of the API. I plan to continue to improve it (but not create a complete game because of obvious copyright reasons).
    GitHub: https://github.com/nkholski/phaser3-es6-webpack
    Questions, suggestions and contributions are all more than welcome.

     
     
  13. Thanks
    casey got a reaction from Sir_G in Create a pane of sprites?   
    https://phaser.io/examples/v2/input/button-open-popup
     
    https://phaser.io/news/2017/10/message-box-tutorial
    This is the most in-depth examples of modal popups: 
    https://github.com/netgfx/phaser_modals
  14. Like
    casey reacted to Brett Paterson in FMOD Studio now available for HTML5   
    FMOD Studio is a cross platform API with a low level component (loads all sound formats, plays them via channels, allows DSP effects, geometry, 3d sound etc) and the FMOD Studio tool API which interfaces with FMOD Studio audio creation tool.  More information here www.fmod.com
    http://www.fmod.org/documentation/#content/generated/platform_js/basics.html has information about the implementation
    there are some audio demos at http://www.fmod.org/public/js and http://www.fmod.org/public/js_studio
    Any questions let me know.
  15. Like
    casey reacted to Garlov in Ticking time bomb in a game   
    When using Phaser, I would really recommend using the game.time helper, and not setTimeout.
    const myTimer = game.time.create() myTimer.add(duration, callback, context) myTimer.start() This will make it a lot easier if you are ever going to create a pause button in your game. The default js setTimeout will just keep going, but the Phaser built-in one will pause as well when you flip the pause bool in Phaser.
  16. Like
    casey reacted to Kalablum in Projected Trajectory   
    Wow, nice.... really something to look into it! 

    Yes i want the guide lines, i will try it now, but i want to "reflect" on the boxes too, they are graphics, i hope this works! haha, tks a lot! 
  17. Thanks
    casey got a reaction from Fenopiù in How to render a HTML page inside Phaser?   
    You may also find this tutorial on overlays useful: https://www.joshmorony.com/creating-a-shop-with-purchasable-items-in-a-phaser-game/
  18. Like
    casey reacted to samme in Brunch with Phaser 3 (starter project)   
    Now comes with Phaser 3.
  19. Like
    casey reacted to jzcodes in Making a 3..2..1.. GO! tween ? (Newbie)   
    I figured it out!! It was a little tricky to find a clear description of the params but, this is what I did! 
    var tween1 = game.add.tween(this.countDown1).to({alpha: 1}, 500, Phaser.Easing.Linear.None, false, 0).to({alpha: 0}, 500, Phaser.Easing.Linear.None, false, 0); var tween2 = game.add.tween(this.countDown2).to({alpha: 1}, 500, Phaser.Easing.Linear.None, false, 0).to({alpha: 0}, 500, Phaser.Easing.Linear.None, false, 0); var tween3 = game.add.tween(this.countDown3).to({alpha: 1}, 500, Phaser.Easing.Linear.None, false, 0).to({alpha: 0}, 500, Phaser.Easing.Linear.None, false, 0); var tweenGo = game.add.tween(this.countDownGo).to({alpha: 1}, 500, Phaser.Easing.Linear.None, false, 0).to({alpha: 0}, 500, Phaser.Easing.Linear.None, false, 0); tween3.chain(tween2); tween2.chain(tween1); tween1.chain(tweenGo); tween3.start();  
  20. Like
    casey reacted to mickeyren in How to detect onClick in Circle graphics ?   
    maybe create a circle Phaser.BitmapData and use that to create a a Phaser.Sprite? Pretty sure sprites can detect input events.
  21. Like
    casey got a reaction from 3man7 in changing animation frames of sprite in array   
    Oh crikey. It was simple. 
     
    The line just needed to send from the original array this.empty not "this" ,  so this.empty.events.onInputDown.add(this.changeFrame, this.empty).  Someday I'll grok this whole programming thing
  22. Haha
    casey got a reaction from Capitaine Herlock in Phaser in Brackets: Pause update not working   
    I had another thread where I went back and forth with @samme about pauseupdate not working. After copying his/her code from CodePen into my file, I discovered that running his/her code from within Brackets also resulted in the pause update not working (not getting pointer data).
    I then ran the code from my file directly in Chrome and Firefox and it didn't work there either (the code runs, no errors thrown, etc. but the pointerdata isn't updated on pause). 
    What am I missing?  How can I get pointerdata on pause? 
     
     
  23. Like
    casey reacted to speedo in phaser auto completion with brackets   
    how to use phaser auto completion in brackets
    --------------------------------------------
    install ternific (extension) [brackets]
    after that,
    go to ::
    for windows::(mac and ubuntu might be quite similar)
    C:\Users\username\AppData\Roaming\Brackets\extensions\user\ternific\node_modules\tern\plugin
    and paste phaser.js (auto completion api)
    (right click and save)
    http://redchilligame.com/tutorials/vim_phaser/js/phaser.js
    create .tern-project at the root dir. of your project file
    and paste and save
    {
    "ecmaVersion": 6,
    "libs": ["browser"],
    "loadEagerly": [],
    "plugins": {
    "phaser" : {},
    "doc_comment": true
    }
    }
    enable ternific::
    at right top side of file option menu, click the ternific option
    file>ternific
    --> now you can use phaser autocompletion with tern-documentation/tern-def
    bonus:: install phaser-chain extension ( for phaser api documentation)
    credits::
    http://redchilligame.com/how_to_use_phaser_with_vim
     


  24. Like
    casey got a reaction from 3man7 in buttons: weird behaviour   
    Thank you, that's helpful. 
  25. Like
    casey reacted to 3man7 in buttons: weird behaviour   
    Hey,
    I think the problem is merely the code ordering + omitting specifying default proprieties + confusion.. ?
    Here's how I'd do it:
    Main.Game = function (game) {}; var pressedOne_bool = false; var pressedTwo_bool = false; var pressedThree_bool = false; var arr; Main.Game.prototype = { preload: function () { this.game.load.image('one', 'phone/phone1.png'); this.game.load.image('two', 'phone/phone2.png'); this.game.load.image('three', 'phone/phone3.png'); this.game.load.image('enter', 'images/enter.png'); }, create: function () { this.one = this.game.add.button(100, 100, 'one', this.pressedOne, this); this.one.tint = 0xFFFFFF; this.two = this.game.add.button(200, 100, 'two', this.pressedTwo, this); this.two.tint = 0xFFFFFF; this.three = this.game.add.button(300, 100, 'three', this.pressedThree, this); this.three.tint = 0xFFFFFF; this.arr = [0, 0, 0]; }, pressedOne: function () { switch (pressedOne_bool) { case false: pressedOne_bool = true; this.one.tint = 0xE6E2F4; this.arr[0] = 1; break; case true: pressedOne_bool = false; this.one.tint = 0xFFFFFF; this.arr[0] = 0; break; } }, pressedTwo: function () { switch (pressedTwo_bool) { case false: pressedTwo_bool = true; this.two.tint = 0xE6E2F4; this.arr[1] = 1; break; case true: pressedTwo_bool = false; this.two.tint = 0xFFFFFF; this.arr[1] = 0; break; } }, pressedThree: function () { switch (pressedThree_bool) { case false: pressedThree_bool = true; this.three.tint = 0xE6E2F4; this.arr[2] = 1; break; case true: pressedThree_bool = false; this.three.tint = 0xFFFFFF; this.arr[2] = 0; break; } }, EnterBtn: function () { console.log(this.arr); }, render: function () { game.debug.text("pressedOne_bool: " + pressedOne_bool, 32, 40); game.debug.text("pressedTwo_bool: " + pressedTwo_bool, 32, 60); game.debug.text("pressedThree_bool: " + pressedThree_bool, 32, 80); game.debug.text("arr: " + this.arr, 32, 120); } } The render function will make you see things better - although it has an impact on fps so be sure to remove it whenever you try to get the best out of your project/game.
    Good luck!