• Content count

  • Joined

  • Last visited

  1. attach sprite to sprite

    Hi, I know I'm almost a year late but I still want to know how to add collision to a child sprite. For example I have a player holding a sword (player.sword) and I want to detect when the sword hits an enemy. The collision for player hitting sprites isn't picking this up. Any ideas? Cheers, Owen
  2. [Phaser] Penguinvaders - updated

    Thanks guys for the feedback. I am going to take on board your comments in the next update. I hope you will comment again. @sodomo - around 25 years total of which 20 professionally (not games though!). I actually feel that my code for this game is very messy and I need to refactor it a lot. @Daniel - TBH, I was deliberately going for a minimal/retro feel with the graphics. I was actually going to make them even simpler at one point. I wanted to capture the spirit of the old Space Invaders games of the 80's. But you're right, nicer graphics would make for a nicer game. Also I do have plans to make changes to alien behaviours and some more random funny stuff too. The aliens currently are all a bit "samey" in the way they move around. I am definitely going to change this so that different levels have different behaviours. Once I get the gameplay finished I may experiment with different sprites or skins for the game as a whole. Onwards to my next update... Thanks again, very useful feedback. Owen
  3. Hello again. Well I have made a lot of changes to this game which is still work-in-progress but it has come a long way since I last asked for feedback many months ago. Basically Penguinvaders is a simple "shoot the aliens in space" game in its purest form, just shooting aliens, collecting power ups, that's all. (The difference being instead of a spaceship you have a penguin!). I wrote it using HTML5 with the Phaser framework. I used MS Paint plus some limited imagination for my sprite creation. I used my 1980's upbringing for some retro games inspiration. I would appreciate any feedback or general thoughts at this stage. It works best in Google Chrome. Performance can be very ropey on low spec machines or mobiles. But it works. Direct link to game: http://www.owensouthwood.com/spacejunk/ My blog article about this game: http://www.owensouthwood.com/Blog.aspx?blogid=games&articleid=penguinvaders My game dev blog including this game's updates: http://www.owensouthwood.com/Blog.aspx?blogid=web-game-development Thanks, Owen
  4. Make a boss sprite 'flash' when hit

    That worked a treat - thanks!
  5. Hi I want to make a boss sprite 'flash' when it takes a hit. I am thinking along the lines of doing something to the colour of the sprite, maybe turn it red then back again. So maybe apply some kind of colour filter on it. What I want to avoid is having to swap to a different coloured sprite and back again. Any ideas? Thanks O.
  6. HTML text input within Phaser canvas

    Thanks. Now I am leaning toward the self-made on screen keyboard as per MarkPal's suggestion. For the purpose of hi-score name entry it might just do the trick and I could make it look nice too.
  7. HTML text input within Phaser canvas

    In theory yes but I can't get a reference to the position of the canvas or position my HTML element in relation to it, so for example it sits in the middle of the canvas.
  8. HTML text input within Phaser canvas

    CanvasInput looks like a really good solution... nice and easy... in theory. But I cannot get it to work. First it gave an error, not finding my canvas even though the ID was correct, then I found a workaround for that so it finds the canvas and now it seems to display the input beneath the canvas, not on top, so I cannot see it. Have you managed to sucessfully use CanvasInput? If so please can you share the code? Owen
  9. HTML text input within Phaser canvas

    Well JS prompt is certainly another option I hadn't considered. The problem is the look and feel is so horribly different and you can't control the details of the input (eg. max length). It could work as a temporary workaround though. Thanks for the idea.
  10. HTML text input within Phaser canvas

    What is that please? Got a link for it?
  11. HTML text input within Phaser canvas

    Well I'm glad it's not just me! Now just thinking of some possible ways around it. How about these: 1. I could write my own text input. This seems a lot of work for a simple feature and won't include all the mobile-friendly assistance built into HTML5/CSS3. On the plus side it would be reusable in later projects and would integrate nicely within the framework. OR 2. Make a separate HTML page outside of the game, which looks similar to the game canvas, but is not a canvas at all, just an HTML web form. Redirect there when user gets a hi score. Then go back to the game when they click submit. This is possibly the easiest way. The hard part is keeping the web form at the exact same size and position as the game div, to make it unnoticeable.
  12. Input Text in Phaser

    Hmmmm. I have this same problem. But I'm sceptical of the 'best answer' (sorry Tom!). Is it really best to make your own when there is a good HTML input available which will work nicely with mobile devices too?
  13. Hi, this is really simple, I just want to include an HTML text input for my hi score entry page where the player can enter their name. I want the text input to appear right in the middle of my game canvas. But I am having trouble positioning any HTML element in relation to the game canvas, or any items within the game div. (I can't seem to even make the input appear on the top left corner of the game canvas). Is there a simple example for displaying an html INPUT element within a Phaser game? Or is there maybe a better way of grabbing text input within a Phaser game? Any ideas? Thanks Owen
  14. [WIP] Penguinvaders

    Penguinvaders is a retro 2D space invaders style game where you control a penguin who shoots invading aliens. The objective is to survive all the waves of aliens and not let them destroy your stock piles of ice cubes and stuff. I used http://www.phaser.io/ as the client framework plus a load of JQuery and Javascript of course. I designed all the sprites myslelf using MS Paint, Photoshop, GIMP. There is some minimal mobile support (on screen controls). But it is much easier / more responsive on a PC using cursor keys to control the penguin. The audio is very much work in progress and you can toggle sound on/off at any time. It works best in Google Chrome using cursor keys as control. Direct link to game: http://www.owensouthwood.com/spacejunk Blog page for this game: http://www.owensouthwood.com/Blog.aspx?blogid=games&articleid=penguinvaders My game dev blog including this and other attempts at game dev: http://www.owensouthwood.com/Blog.aspx?blogid=games This is a work in progress project which I am constantly updating, you can follow updates on my Twitter account (see website). I would welcome any honest critical feedback during development. Thanks! Owen
  15. Hi, another newbie-ish question here. I'm happy with moving sprites using tweens when the path is a straight line, but I also want to move a sprite around in curved path, like a rainbow or a U shape or possibly an oval or circle. I am struggling to understand how I can do this with a tween. I need a simple example or two ideally. Can anyone help? thanks Owen