Leaderboard


Popular Content

Showing content with the highest reputation on 04/07/14 in all areas

  1. 1 point
    I have this code right here: image.events.onInputDown.add(clickListener, this); It calls the function clickListener, but I'm confused with the rest. I was taking a look at the source and I didn't find any way to pass an argument to clickListener when I clicked on my sprite. I wonder if there is a way of passing arguments to a function when I click down a sprite (onInputDown)?
  2. 1 point
    turnA

    [Phaser] Elevator Miner

    Hi there! This week we want to share about our newest games, Elevator Miner! Elevator Miner is an arcade/action games where you must control the elevator on the right/left side of the screen to move the digger, and dig all the treasure while avoiding all the obstacle. If you're using desktop, you can use W/S to move the left elevator and UP/DOWN Arrow to move the right elevator. Of course on mobile you can just drag the elevator with both of your finger. Link: http://j.mp/elevatorminer Hope you enjoy it! Do let me know if you have any feedback/problem
  3. 1 point
    I'm going to make the one game per week challenge also, is not like I'm ripping off your idea...
  4. 1 point
    Lowren

    Gender Jam

    Hi all, I would like to share a game jam that sounds interesting to me. Called the gender jam, the goal is to make a game based on gender, preferably related to your own experience. The game has to be about anything that is gender-themed, like differences between men and women, feminism, seduction, homosexuality, sexism etc (just some examples). As a woman in the game industry, I found it particulary interesting. Let's mention that this game jam has been canceled and reported several times, and the jam creator finally hosted it on her website due to hosters issues (e.g it was on itch.io but canceled at the last minute). It's running for all april. http://www.deviever.com/?p=76
  5. 1 point
    adamyall, that was it, thanks!! the Joystick mobile calculations were still using the ".center.x", which was deprecated in 2.0. Thanks, so much for that info. Ross
  6. 1 point
    And my new game is... a snake remake. With a twist! You can play it here
  7. 1 point
    1. Works fine now. Way better! 2. I don't think it's the same. I bought the first update and it didn't change much and it still felt like a constant value, not like it was slowly increasing. I meant that the speed could increase depending on how steep the rope goes down. You could still "sell" upgrades for that increase factor, though, but I might change the dynamic of it. 3. Are you still on a Phaser 1.x version? Then ok, this may be true. But changing the bounding box size is a start. 4. Well no overlapping now but still I think you need to get more control of your random in order to generate more interesting levels still having these issues quite often: - Can't reach artifact because the avatar travels so slow there is no way I'll get there in time. Then there's a new artifact coming up on the other side and again, I can't reach it because of traveling speed. Quite frustrating. - Had 5 obstacles in a row with no artifact coming up. Quite boring. I think if you tinker on the game design with treasure/obstacle spawning and traveling speed a little you'll manage to get the frustration out. 5. No, don't toss it, keep it! But maybe some hair-lines in the mustache would help
  8. 1 point
    Martiny

    [Phaser] Elevator Miner

    The game is awesome! Very beautiful and fun to play, I hope you can profit a lot from it (: The only thing that annoyed me was the collision really. I clearly didn't hit an obstacle, but I lost anyway. Maybe it's not what you want, but a simple fix would be to make the collision box of obstacles a little bit smaller. I guess that is common among games: enemies hitbox are smaller than friendly objects. I've seen this in this image, from this site: http://devmag.org.za/2011/01/18/11-tips-for-making-a-fun-platformer/ Good game (:
  9. 1 point
    Hi, Have you tried this? http://www.html5gamedevs.com/topic/5033-fixed-game-canvas-widthheight/
  10. 1 point
    Feldspar

    Issue regarding position update

    That's very likely the problem is here.. Thanks for your help !
  11. 1 point
    Higher order functions are definitely a valid technique, particularly if you want to preserve the value of your context. You did a better job of explaining them than I would have.
  12. 1 point
    bmceldowney's solution is probably more simple than mine, but there is another solution in case you don't want to create a new object. This solution uses a feature of JavaScript called a "closure". Basically, whenever you use Signal.add (like with onInputDown.add) you will pass a function that takes no parameters: onInputDown.add(myNoArgumentFunction); But this is only good if the function you want it to call doesn't need arguments. So you might be tempted to wrap your function WITH arguments in a function WITHOUT arguments, which would leave you a function like this: onInputDown.add(function(){myArgumentFunction(someVar)}); The problem with that is that you aren't actually creating a new function, so if you set up input on a loop of 3 items, you may always use the last value assigned to the variable. In my example you actually pass into add() the result of a function that generates a no argument function. You can see the pitfall on the first row, and the working solution on the second row. Here is a fiddle containing my solution: http://jsfiddle.net/adamholdenyall/wk6T3/1/ Like it said, it may be overkill and the other solution may be a better fit, but closures are important to JavaScript and a good tool to have available. Further reading: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Closures
  13. 1 point
    The second parameter is the context of the listener. You could pass an object there like this: image.events.onInputDown.add(clickListener, {param1: value1, param2: value2});Then in the clickListener: function clickListener () { this.param1 // equal to value1 this.param2 // equal to value2}
  14. 1 point
    Another optimization trick that's used in games is to work with squared distances, which avoids the square root operation on each distance calculation. So for example if you wanted to test if an object was within 20 pixels of the player, you'd test for this (pseudocode): testDistSq > (xDist * xDist + yDist * yDist) where: testDistSq = 20*20 (compute only once) xDist = playerX - enemyX yDist = playerY - enemyY Instead of testing for this each time: 20 > sqrt(xDist*xDist + yDist*yDist) This should be significantly faster when dealing with large numbers of comparisons, and you can always compute the actual distance after the fact for the in-range enemies if needed.
  15. 1 point
    http://jsfiddle.net/adamholdenyall/bpPJd/1/ Pretty simple. Wanted to show you that depending on the style of your game you may want to enable or disable the "smoothed" flag.
  16. 1 point
    I didn't test your code, but I think the answer may simply be that you are trying to run pause/resume code unconventionally. Here is a working fiddle that shows how to add event handlers to the pause event. You can actually add as many as you want! Much easier to manage. http://jsfiddle.net/adamholdenyall/LLddd/1/
  17. 1 point
    rich

    how to restart/reload a state?

    And actually in 2.0.3 you can do: game.state.restart();
  18. 1 point
    end3r

    Need Cool HTML5 Games Sites

    No, I work on everything! ;D