xronn

Members
  • Content Count

    129
  • Joined

  • Last visited

Everything posted by xronn

  1. Agreed there is only a single quest, no controls/settings etc... if developed further I would be looking to adding combat, health systems, maybe skill trees. Thankyou for the feedback
  2. I've been working on pixel quest for a few months now and I wanted to showcase it for the first time! The game is more of a proof of concept rather than a full commercial game but I would appreciate any feedback on usability or anything you feel i need to add / adjust. Hopefully this game is something a little different for the phaser community and I hope you like what I've come up with so far! Play Link Back Soon! Credits coming soon!
  3. That works really well, thank you for the input this solved the issue wonderful thanks!
  4. So the canvas? or does phaser have some jargon for targeting the game element
  5. Aha, I'm not sure I understand how to apply it could someone show can example? $(".chat-entry").focus(function() { Phaser.Keyboard.removeKeyCapture(interactButton.Phaser.Keyboard.SPACEBAR); interactButton.enabled = false; });I can't call phaser outside of phaser so how do I know when to turn it off ;/
  6. Hi, How would I do that I'm calling it in phaser as such - interactButton = game.input.keyboard.addKey(Phaser.Keyboard.SPACEBAR);Should I just write the JS to do the correct action as default?
  7. Hey, I'm using spacebar as an interaction key in my phaser game, but I also want to use spacebar for my chatbox running on the same page. Unfortunately I can't put spaces in between words in my chat box because phaser won't allow it. Is there anyway to get around this?
  8. Hey, I have a small bit of UI and I want the wrap the text at a max width but it doesn't seem to wrap at all. I'm not getting any errors just not the result I would expect. inventList = invent.join(', '); inventItems = game.add.text(37, 468, inventList.toString(), {font: "12px Arial", fill: "#000000", align: 'left'}); inventItems.fixedToCamera = true; inventItems.alpha = 1; inventItems.maxWidth = 150;So Im basically display an array, but I've used the join to put spaces in between the results. I've also tried a list of plain text that also didn't reduce the width
  9. This is basically what I need however it uses the isDown call which is what Im using... Do you know if it solves the issue just by adding time between events, I didn't really want to start adding timed delays between keyboard input. A callback method will work for everyone who uses a key for a single purpose e.g. moving the player up... However my spacebar input is used as an interaction thus requiring it to be used all over my game so it can't have a single callback.
  10. I'm using the spacebar as shown below - interactButton = game.input.keyboard.addKey(Phaser.Keyboard.SPACEBAR);Then I call it as such - if (quest1 == false && interactButton.isDown)The problem is if you tap the spacebar you hold it down for 3 or 4 milliseconds thus meaning the if statement is run 3 or 4 times, which isn't any good. If I change it too - if (quest1 == false && interactButton.isUp)Then when I tap the spacebar the whole time it's up after the tap which is until I press it down again it loops through the if statement which isn't any good either. Does Phaser support something like a tap listener so when its down and then up it runs once not 100s of times as it currently does.
  11. Aha, thank you likaos I like you're idea too, I'll give it a go thanks!
  12. Hi, I'm trying to set all my physics setting for a group so when I draw each of my sprites I don't have to write the same code over and over again. npcGroup = game.add.group(); npcGroup.setAll('body.setSize', 19,26); npcGroup.setAll('body.immovable', true); npcGroup.setAll('body.moves', false); game.physics.enable(npcGroup, Phaser.Physics.ARCADE);Thats what I got but it doesn't appear to work, although I don't get any errors in the console either. Edit: I've updated these sections which now work - npcGroup.enableBody = true; npcGroup.physicsBodyType = Phaser.Physics.ARCADE;
  13. Hi, thanks so much for the demo I really like that second option, could you explain the use of "el" in the forEach
  14. I mean a number of game sprites not tiles, such as players/npcs, instead of drawing each one at a position with the key, looking for an example of how this could be done. If not then is using groups best? Edit: Posted from a member of the team of the op
  15. Yeah I suppose, but how can I call them from an external js file if I want to have say a userInterface.js I'll preload the images then in my game create I'll draw them but then how can I write my own js inside my userInterface.js file. I wouldn't have anyway of calling the ui sprites I've drawn on in the create?
  16. Hi, I want to write my own javascript as part of my game, so I'm loading another js file such as menu.js and then inside that file I want to draw my own image to the canvas so I write the following code; var canvas = document.getElementById('canvas');var ctx = canvas.getContext('2d');var backpackBtn = new Image(); backpackBtn.onload = function() { ctx.drawImage(backpackBtn, 50, 630); }; backpackBtn.src = '././sprites/ui/item_btn.png';But phaser uses the canvas in webgl mode, and a canvas can't have both webgl and 2d, so can i make phaser use 2d so I can write my own javascript along side?
  17. Hi I'm using states but I need to pass in another parameter to the default new phaser.game arguments, let me show you what I mean; var game = new Phaser.Game(800, 600, Phaser.AUTO, 'phaser-example', { preload: preload, create: eurecaClientSetup, update: update, render: render });You see that example uses the "EurecaClientSetup" in the create how can I pass that argument when the code is formatted using states? For example I would need - gameName.Game.prototype = { create: function EurecaClientSetup() { }}
  18. Aha, I literally was thinking exactly this after I posted, thanks for your help!
  19. Hi, When I present the user with dialog in my game I want to call the function dialog: function () {storyBackground = this.add.sprite(100, 35, 'text_scroll');storyBackground.fixedToCamera = true;questText = this.add.bitmapText(135, 100, 'text', 'Dam! Its hot out here! \n \n I want to get my tan on, is there anyway you could \n deliver this letter for me? \n \n Great, please take this letter north-west to a small \n camp and hand it to Jacob. He will reward you for \n your efforts. \n \n \n \n Press space to continue...', 14);questText.tint = 000000;}, But I want to be able to pass the text into the function, else I'll have to create 100's of functions for all my dialog, what would be the best way of adding dialog so that I don't need to create 100s of functions each time.
  20. I will do but I need external assets, how can i bring in external sprites to demo in the phaser sandbox?
  21. Hi, I had a go using the updateCrop but not errors, or changes to the width of my sprite unfortunately. My healthbar isn't just a red rectangle, its a rounded shape with multiple colours. I'll keep working on it and if I find a solution I'll post it here
  22. This exact code worked before in 1.2 I think it was so I'm not sure whats changed these days, I've had a look and I think crop should be working
  23. So I'm trying to display a players health this is what I've come up with so far - Create - healthbar = this.add.sprite(38, 616, 'healthbar');healthbar.fixedToCamera = true;healthbar.cropEnabled = true;maxHealth = 100;player.alive = true;Update - healthbar.crop.width = (player.health / maxHealth) * healthbar.width;Basically when a player takes damage the player.health will drop below the maxHealth which would hopefully crop the health bar, unfortunately I don't get any errors and when I take damage say down to 67 hp the crop doesn't run on the healthbar and it remains are full width.
  24. Thanks for the info above, I'll have a look into them. I didn't know if there was something like a php include I could use. Just so I could cut a snippet out then include a link to that file in the middle of the create function. I don't really want to start re-writing everything it was just to compress my game.js file