• Content count

  • Joined

  • Last visited

1 Follower

About Jimaginary

  • Rank
  1. Anyone Using Redux with Phaser?

    Hey @mattsyles, thanks for responding! I could see how Redux actions would add an extra event dispatch, but do you really think it's that much overhead? How else would you manage a complex state of a game across different files?
  2. Anyone Using Redux with Phaser?

    So I started a project in es5 javascript and put everything in one huge game file. This quickly became hard to manage so I decided to use ES6 Javascript and break things out into their own classes. However, I then realized that there are times when these different classes need to display and modify the same data. In a part project I've used Redux with react which was pretty awesome, and I've used shivering very similar in angular 2 (Ngrx library). In another post about React it seems like people are saying the virtual DOM, JSX, and all that is pretty much useless with the way that phaser renders in canvas and doesn't really use any HTML. However, I just stumbled across this really cool jsfiddle that uses the redux library, straight up, as a way to manage state with redux alone: https://jsfiddle.net/archierocks183/zygz2ksm/17/ What do you guys think about this? Do you think it's a good way to go? Does anyone have any projects where you've gone down his route (or something similar)? How did it go? Just trying to get ideas and figure out how to manage state in my growing app. Thanks!
  3. Can we make a multiplayer game without a remote server?

    It may be "possible", but having an authoritative client can open you up to backing, cheating, etc. It's a much better idea IMO to have an actual server.
  4. Brunch with Phaser 3 (starter project)

    Hey, great project! I am having trouble scaffolding out the es6 version though. Currently, I can run this to get an es5 project: brunch new -s samme/brunch-phaser Can someone help with with the command to create this version in preferably es6, but out of curiosity typescript as well and for bonus points clojurescript.
  5. Extended object function troubles

    Your problem is that "dummy.body" is null when you are trying to access the property "static". You are a valiant warrior for attempting to use prototype's in an OOP fashion. I would recommend just using regular classes with Es6 or TypeScript. Or you could use some component pattern from a framework like Angular or React.
  6. Room Walkers!

    Hey guys, sorry about giving you a link to a broken app! I was finally able to get it hosted with HTTPS and secure websockets (was pretty frustrating though!). I also had to get a domain name for the ssl certificate so I bought this cheap one: gameof.ninja. lol Now when you type in your name and click play you should be able to control a little ninja. Use arrow keys to move, space to slash your sword, and hold shift to strafe. You should be able to walk around and attack other players in the room. For some reason I seems that the server crashes and restarts when a dead player refreshes the page, but I just wanted to get it out there and see what people think. I imagined this being similar to http://agar.io/ where the game begins with a popup asking you for your name and then drops you into the world where you play until you die and are then brought back to the initial popup. In terms of making the game look nicer I want to make the map nicer export out the images better (for example, the character is being scaled down to 1/4 size which is why it looks really pixelated). For making it more fun I want to add a long ranged attack (a key) and a defensive shield move (s key or d key). I'm also considering allowing the user to choose between different types of ninjas on the initial popup page (eg. fighter ninja, archer ninja, mage ninja...). These different ninja types would have different starting stats and possible their own special move in addition to a basic attack and basic long-range attack. I'm also thinking about having an in-game shop where you can power up your character until you die, but I don't want some people too be too OP and run around killing everyone (although that would be pretty funny, wouldn't it?). Anyway, give it a try and let me know what you think. https://gameof.ninja
  7. Phaserjs Object Layer

    Use game.add(sprite); to add it to the screen.
  8. Effiency of reusing game objects

    I agree with mattystyles. It depends on how many platforms you are using and how you would use them. I doubt you would see performance problems if you just use .destroy() to kill a platform, but I do remember watching a flash game tutorial from Lee brimelow about object pooling so yes, that is a thing. Also, I wouldn't really have an array called "destroyedPlatforms" because your destroyed platforms would go back into a pool to be used on the screen again. Instead, I would have one array named "platformPool" and one named "platformsInGame" or something like that.
  9. How can add a label over sprite?

    Hi, just to clarify - is there really no way to add text to a sprite? It always had to be added to the game over? I'm creating a game where the labels are over the characters' heads, but the characters are moving so every time I move the character I have to also move it's corresponding text field. It just seems more verbose and computationally expensive than adding text as a child of a sprite.
  10. Callback when animation complete?

    nice! But suppose a sprite had multiple animations added to it. Is there a way in the onComplete callback function to know which animation it was that just completed?
  11. Simple Question: How to Change size of an image

    scaleTo works, but I'm using "this.cat.scale.setTo(.05, .05);" which REALLY makes the image pixelated and not good looking. How can I have nice, crip graphics but still kep them small? I'm using texturepacker, but I don't think I can change the size of the images in there... Do I need to shrink the images in spriter and/or illustrator? I bought this spritesheet, but I'm having trouble adding it into my game and having it look good. :/
  12. The problem of the sprite key

    I am having the same problem. It says "Texture with key 'TEXTRUE_NAME' not found."
  13. Room Walkers!

    Hmm it looks like the place I was hosting the client uses secure https and is blocking the websocket connection. Let me try to set it up with SSL websocket, and I'll let you know when to try again. thanks.
  14. Hi, I'm trying to build a top-down 2d game. You can find the code for it here: https://github.com/JimTheMan/Room-Walkers Here is a screenshot of the game using "this.scale.scaleMode = Phaser.ScaleManager.NO_SCALE ;" The game works, but there are a few issues I'm having: 1) The "viewport" always shows an area of 10 x 10 tiles. As the player moves the camera follows him and he appears to be moving around the map. However, the viewport is always 10 x x10. Is there a way to change this, for example, to where the viewport always showed an area of 20x20 tiles? 2) When I use "NO_SCALE" mode everything looks super tiny, but when I use any scale mode (such as SHOW_ALL) the text looks blurry and is completely unreadable... How can I have graphics that are large enough to see while still keeping nice, crisp fonts? thanks.
  15. Room Walkers!

    Hi everyone, I just finished this little project that I call Room Walkers. You can play it here: https://room-walkers.firebaseapp.com/ In the top-left corner enter a name and click "Play!". Then a character will appear which you can control with arrow keys. When other players join you can see them and they can see you as well. There is no attacking or messaging in this game, just walking around. I used basic JavaScript Phaser with NodeJS "ws" library on the backend. Let me know what you guys think. woot.