Search the Community

Showing results for tags 'phaser 2.2.2'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Coding and Game Design
  • Frameworks
    • Phaser
    • Pixi.js
    • Babylon.js
    • Panda.js
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

Found 43 results

  1. My guess is, I have to send a physicsConfig parameter to my game constructor in order to have arcade physics object inside my game object. This is my game constructor and the last parameter is not set up. var game = new Phaser.Game(800, 600, Phaser.AUTO, '', { preload: preload, create: create, update: update }, false, true, physicsConfig);What should I include inside physicsConfig = { } in order to have Arcade base system and avoid creation of new Arcade object? arcade = new Phaser.Physics.Arcade(game);I am using Phaser 2.2.2
  2. With some hacks from these two links: http://stackoverflow.com/questions/21406781/how-can-i-bring-up-the-keyboard-on-mobile-devices-to-catch-the-input-for-drawing?lq=1 I managed to open the keyboard on my android device. However the keystrokes i do are not sent to the Phaser game i.e my Phaser text field is not filled with data. <input id="hiddenInput" type="text" name="hiddenInput" style="position:absolute; left:-1px; top: -1px; width:1px; height:1px; opacity:0;"/> <script> $(document).ready( function() { $("#hiddenInput").focus(); }); </script> I am using Intel XDK and I upgraded my project to use cordova plugins. I installed ionic-plugin-keyboard but it behaves similar, i.e show/hide the keyboard but the input is not detected by Phaser. What do I miss to do or what do i do wrong? Any suggestions?
  3. Trying to add support for mobile. My game is a typing game and I need to bring the keyboard up automatically. I added a text input element in my html with auto-focus and yes I see the keyboard once I load the page but it squeezes the canvas into the space available between the keyboard and the rest of the screen. What should i do to prevent this? The size of the canvas is 480x720. It should look fine on Nexus 7 which is 800x1280
  4. I find my self often using console.log() to log for messages while developing which does the job but in the end I should remove all those log statements. So I though it would be nice if I use my own debug text field in Phaser. Yes I made one and it works but how to log messages on screen when all the JS scripts are still not loaded i.e before the game code loads? So, the new canvas API has methods to draw text inside but I don't see the canvas html element being created by Phaser to have its own ID or name. Yes I could possibly do it with custom JS function but are there some tools to help me already? Or I just create separate html element like paragraph and write log messages inside of it and don't bother with the canvas? https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial/Drawing_text
  5. Wasn't sure if to create new topic or reply to the list of phaser games, but anyway, I made a typing game called Sandhi Invaders. Two letters fall from the top and you need to type the correct letter combination to earn a points and progress trough the game. Not sure about the details but it is some sort of bypass alphabet for the Sanskrit language which has letters that cannot be typed on regular QWERTY keyboard so you need to type letter combos to guess the correct IAST/Sanskrit letter. Read the help pages in the game to get some idea. The game is available here: http://sandhi-practices.rhcloud.com/ And the answers are available here: http://sandhi-practices.rhcloud.com/answers/Letters.html I know its looks plain but I would like it tested and get some feedback if possible. Thanks.
  6. I have explosion spritesheet which is 2048x128 size. As you can see it is POT(power of two) for width and height, but still I get error when loading my game: phaser.min.js:6, Uncaught Error: Texture Error: frame does not fit inside the base Texture dimensions [object Object] Did I miss to set up some setting in Phaser or just the texture is too large in width? I cleared my cache btw and still get the same error. The spritesheet has 16 frames so i could possibly create an atlas 4x4 but still, should i bother?
  7. Browse full list of keyboard buttons

    Is there a way to see the full list of keyboard buttons? For example Phaser.Keyboard.SPACEBAR, Phaser.Keyboard.ONE, Phaser.Keyboard.TWO etc... I cannot see these "constants" in the phaser 2.2.2 docs. For example I need dot, single quote, dash(minus), ~
  8. Draw data table in a scene

    Is there some plugin or some tool inside Phaser that can help me draw a table of data. I have this image: As you can see I have two arrays of data and they are drawn in Phaser text field as string, but since the numbers inside are of different string length points array is longer than errors array and therefore cut if over the screen boundaires. How can I draw a table with this data, 3 rows by 15 columns? Also could I possibly create such plugin for Phaser?
  9. Group vs Group in Phaser

    As shown in this topic: It seems, separate groups are interleaved. How do they function with the z-index between each other? If I create group1 first and group2, group1 is below group2 right? What if I add element1 first to group2 and then element2 to group1 will element1 be above element2 since group2 was created later or its vice versa? Can somebody explain me how Phaser groups work?
  10. I have this code: init: function () { screenObjects = gameObject.add.group(); guidesGroup = gameObject.add.group(); }, create: function () { guide1 = gameObject.add.sprite(0, 0, si.ImageAssetKeys.GUIDE_1_IMG); guide1.name = 'guide1'; screenObjects.add(guide1); guidesGroup.add(guide1); guide2 = gameObject.add.sprite(0, 0, si.ImageAssetKeys.GUIDE_2_IMG); guide2.name = 'guide2'; screenObjects.add(guide2); guidesGroup.add(guide2); guide3 = gameObject.add.sprite(0, 0, si.ImageAssetKeys.GUIDE_3_IMG); guide3.name = 'guide3'; screenObjects.add(guide3); guidesGroup.add(guide3); nextButton = si.SIButton.SIButton(360, 670, si.ImageAssetKeys.GUIDE_BUTTONS_SHEET, thisObject, click, 3, 2, 2, 3); screenObjects.add(nextButton); prevButton = si.SIButton.SIButton(10, 670, si.ImageAssetKeys.GUIDE_BUTTONS_SHEET, thisObject, click, 1, 0, 0, 1); screenObjects.add(prevButton); } As you can see guides belong to screenObjects and guidesGroup groups, but previousButton and nextButton belong to only screenObjects. I am using this code to fade in/out guides in guidesGroup but the problem is the next and previous buttons are faded out as well. guidesGroup.forEach(function (item) { var siObject = this; item.alpha = 0; if (item.name === 'guide1') { siObject.gameObject.add.tween(item).to({alpha: 1}, si.Const.FADE_DURATION, siObject.Const.TWEEN_LINEAR, true); } }, si); Is there some mixing between game groups, are they distinct if same object belong to two groups?
  11. I tried to cover the whole screen aka 480x720 canvas with a text field, font size 150 and also set width and height to 720 and 480 accordingly but no success. I want to cover the screen with semitransparent text and as I type on my keyboard I should see the letters I type. How can I achieve this?
  12. How to pause two sprite boxes?

    I found there are two different approaches on how to pause game. game.pause = true; efectively pauses all subsystems in the game including the buttons, so I cannot press on them if this property is set to true. Yes I found this example http://phaser.io/examples/v2/misc/pause-menu which calculates where you pressed and if the click was on the pause btn it unpauses the game. I have just two sprites with two text objects above them. They move as text boxes togheter and fall down to the ground. Once they reach(hit) the ground the game is over. I also found this property Physics.Arcade.isPaused which I cannot find in Phaser 2.2.2 documentation and my browser as well tells me that this property does not exits. What is the best way to stop two text boxes to fall down when I press a pause button but being able to press that button again? Should I use some hacks like remove update function and then add it again or something like set sprite velocity to 0 and then revert it back again to 100.?
  13. How to remove graphics and text object

    I have this object called LetterBox: letterBox = { graphics: null, boxText: null }; I use this code to initialize the two parts: letterBox.graphics = gameObject.add.graphics(0, 0); letterBox.boxText = gameObject.add.text(boxX, boxY, textData); What is the best way to cleare these two object? There is Phaser.Graphics.removeChild(DisplayObject), but should I use this method like this trough top level class? How about the text, how should I remove it?
  14. I want to make several unit tests that test my loading functionality. That means i have to run Phaser.Cache.destroy() just so I make sure the assets were not loaded by the previous test. The problem is destroy() makes the cache null which is not what I want. I just want to clear the data it holds. I even tried this: game.cache = new Phaser.Cache(game); But it doesn't seem to be working. What should I do in this case?
  15. Unit Testing my Game with JSUnit

    I have this test: function testLoadAtlasJSONHash_CreateCustomJSONAtlasAndRunTheFunc_PassesIfThePhaserLoaderContainsTheAssetKey () { var keyName = 'KEY_NAME', keyValue = 'keyValue', sheetUrl = 'assets/testing/images/guidesAndBackgrounds.png', sheetConfigUrl = 'assets/testing/settings/guidesAndBackgroundsHash.json'; WML.addConstant(WML.ImageAssetKeys, keyName, keyValue); game.load.atlasJSONHash(WML.ImageAssetKeys[keyName], sheetUrl, sheetConfigUrl); assertTrue(game.load.checkKeyExists(Phaser.Loader.TEXTURE_ATLAS_JSON_HASH, keyName)); } Note: I have separate tests which pass for WML.ImageAssetKeys[keyName] and for WML.addConstant() And I am not sure where it is failing. checkKeyExists() returns false. How can I know or find why it returns false?
  16. I am adding new Atlas Json Hash object and I want to check if its key exists in the Loader. I would do this: game.load.checkKeyExists(type, myKey) Bu I am not sure what to use as type. I know I should use game.cache.someconstant but which on is for Atlas JSON Hash ?
  17. Phaser 2.2.2 template project

    I made a simple template project on how to structure your code in multiple files. View it here: https://github.com/bluePlayer/practices/tree/master/Phaser2Structure Additionally I created some helper functions to aid my self in development, you could find them useful too... Things I would like to see in Phaser 2.3 or Phaser 3 are: 1. Asset key store where we could save keys of our assets and access them using just the name of the key, like a constant. Check the code there is a whole code about it. 2. Each game state should have KEY property holding the name of the State. 3. Additional functionality for transition between states, for example (fade out-fade in) or checker board or bubbles or whatever. Just a thought. I had to use Tween and hold all state objects in a group to fade them. 4. Maybe some support for GPGS or other scoreboard system if any. Just a thought. I used the same code to build my APK file so there weren't changes and it worked on device. Let me know your thoughts on the code.
  18. Timer vs update

    In my memory game there are two loop timers, one which runs on each 100 milliseconds and second on each 1000 milliseconds. We cannot forget also the update() function which comes along the Phaser.State class. In the 100 mil timer I do stuff like replacing cards by position, and showing helper arrows. On the 1000 mil timer I just increment the clock by one second. All works well but the code got kind of too cluttered so I am afraid, I could break something at this point. For best performance, is it good to use only one timer and no update() method or should I just move all in update() method and count the number of frames passed?
  19. Regression testing, QA etc...

    Not sure if this is right question for this forum. It is more an engineering question than Phaser related, but anyway. How big has to be your javascript state files to be worried about the overall success of your project? When should I start developing regression tests, with Jasmine.js? How can I do QA for my game, tools, techniques, methods? My GameScreen.js state become 500 lines of code
  20. So yes I reached alpha version of my game Non optimized. Has lot of other things to be done to improve quality. But anyway its been month and a half now, since I started reworking in HTML5/Phaser2 from Flash/AS3/Stencyl. I want to show off. Here is the link: http://wml-spinnerbox.rhcloud.com/ It might take some time to load. I have posted several questions for the game: Would you like to see more cards, scoreboard, more levels and even multiplayer option? Or it is just plain boring memory game? Also it would be nice if I could provide mobile version for it. What do you think? Let me know our thoughts. Best regards, Vlado.
  21. Max size of srpitesheet allowed?

    This is a question for more experienced than me working with Phaser. I have a spritesheet which is 1400 x 5320. The game works, no warnings no errors and it seems this size is allowed. Are there any limitations of a spritesheet which I should follow when porting the game to mobile or desktop? Should I cut the image in two or three smaller images?
  22. Firefox process allocates 1GB of RAM

    While developing my game, I refresh the same page many times. Though it doesn't have some complex tasks to do except Timer events, the Firefox process gets too big in allocated memory, around 1GB after 10 or more refreshes of the page. I am sure it is my game since I have it loaded alone in Firefox. What do I miss to do or should I do to clear memory that the game allocates, after each refresh? Is this connected with the browser or is there some Phaser code that is good to be implemented?
  23. How to access Atlas data?

    I am using game.load.atlasJSONHash('boxes', 'boxesSheet.png', 'boxesSheetHash.js');where the hash file was generated by ShoeBox for Pixi.js and the line above works. Each of the boxes should be button and Phaser.Button constructor accepts 4 frames, up, down, over and out. Since ShoeBox doesn't have option for custom sorting of the images when creating the spritesheet, I have to map each frame with each frame number it has in order to display my buttons with the 4 states. I also know that game.cache has useful functions to access loaded assets in Phaser. Which function is the most appropriate to get data from the loaded atlas above? getRenderTexture(), getTilemapData() return null since they think 'boxes' is invalid key.
  24. Probably there is already similar question on the topic. I just wanted to know how should my json file look like if I have my atlas of several related game images? Is there some general structure? Specifically I would like to have both as hash and as array? I tried this tool https://spritesheetpacker.codeplex.com/ and it works great but it generates plain text file as configuration. So I need to edit it my self. Yes I have heard about TexturePacker which is the right tool for the job but I need this for just several images, so buying it kind of doesn't pays off. Also has somebody tried to use Phaser to generate spritesheets before? I think there is a way how to keep transparency inside the images generated from HTML canvas.
  25. Cannot load spritesheet in Phaser

    I have this spritesheet: And I use this code to load it into my game: wml.loadSpriteSheet('GUIDE_BUTTONS_SHEET', null, 'assets/images/UI/guideButtonsSheet.png', 50, 60, 8);Where loadSpriteSheet() is a helper function that uses game.load.spritesheet() from Phaser.Loader class. The dimesions 50 width and 60 height per frame are just too small for the real size of the spritesheet. The real width and heigth of it is 196x156. I set it to 50x60 so that the game can load without giving error. Anything above 50 width gives error in Firebug. Can somebody give me a clue why it refuses to load the image? Can the irregular form of the frame cause some trouble? The error in Firebug: Error: Texture Error: frame does not fit inside the base Texture dimensions [object Object]