raaaahman

Members
  • Content Count

    15
  • Joined

  • Last visited

About raaaahman

  • Rank
    Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. I've watched it. She does a good job presenting the framework, although it's only the "surface" of it, kinda equivalent to the "Making your first Phaser Game" tutorial on the phaser.io site. She started with a quick overview of some change from v2 to v3 and then showed an actual folder structure she uses, but then swapped for a big messy file with all the game code in it. I was slightly disappointed in the end, though I'll still recommend the video for curious people.
  2. Oh, I never thought doing it in this direction. Of course that's opinionated. Each technique has its pros and cons... But since you were asking to separate Game Logic from Display Logic it sounds strange to me that you want to somehow remerge it in the framework after that. I'm not arguing what you should or shouldn't do, of course, and maybe Phaser 3 can do that ...
  3. PsichiX answer makes total sense to me, but I wanted to come back on your declaration: why do you separate different levels into different scenes? In most games, levels share so many similarities that you would probably have to duplicate lots of code doing these. It would be a lot easier to load different levels' datas into the same scene. Maybe your game is not so classical and kind of demands it, but I'm having trouble to find an example where you'd want the player to act exactly the same in a totally different kind of scene... I don't believe engines should enforce game logic, firstly because you should be able to make any kind of gameplay without being influenced, but also because it will make your game to heavily coupled with the engine, making your life hard either to port your game to another engine, but either to adapt to the engines future changes. I've not really dived into Phaser 3 for now, but I remember that in Phaser 2, the Sprite class has a Body property when you activated some physics engine. I found it super counter-intuitive, because sprites objects did have more stuffed into them than just their display responsibility... (I believe they did have health and ammunition counters to...) I don't know how are physics bodies handled now, and I hope it would be more natural to give some 'entities' classes bodies and sprites without any being coupled to the other.
  4. Well done for a first game, simple but quite complete. Just don't forget that a game needs sounds to inform the player its action are taken into account.
  5. Hi! I gathered a small team to participate in this summer's Ludum Dare. We managed to build a functional game with Phaser so here's the link: Oppressiv Light Pitch: You're a robot lost in an abandoned spaceship, most of the lights have faded out and there's an alien that lurks in the dark. You can frighten him with your embedded lamp, but beware to not run out of power! (you can charge your lamp by reaching the lit areas) Find the switch that will get the lights back in the whole level and proceed to the next . If you want to give us a feedback about the game, the best place would be on its Ludum Dare's submission page (but you need an account to do so), or just write here or on the itch.io page, I'll read it anyway. You can also view the source code on it's GitHub repository, but it's pretty messy...
  6. Nope, it won't help. Not if you're coding with Pahser JS at least. Because you're coding with Phaser API that internally handles canvas and DOM API for you, in a different way that GMS web exports handles internally canvas and DOM API, so you're not really learning the same thing. If what you want to do is game development, then develop games. JS or GML, the difference should be small, at least smaller than the difference between the framework you're using (GMS !== Phaser !== Unity). Now the question is what kind of games you do want to develop, and what support is best suited for them? Because we don't play browser based games like we play games from our Steam (or anything-alike) library or games we downloaded on our mobile. This is not the same sessions duration or number here, and we probably don't expect the same thing from them (at least I do). If what you want to do is make a living out of coding, then it's another story...
  7. Ok, now with some lines of code I can understand the problem a little better: Your background is a sprite, which by default lives in the world, which is reset when you change the state, as you can read in the doc: http://www.phaser.io/docs/2.6.2/Phaser.StateManager.html#start This is the expected behavior, as you probably change background from one state to another more often than not. So the background will be destroyed and recreated each state, if there's no loading time between destruction and creation, it might not be visible. Now the doc provides another useful information: the stage (different from the state!) is not reset between states, so everything that is contained in there will live until you destroy it manually... But I've not tested this kind of solutions... For your new error, it would be useful to see how you are loading your 'bg' image, because its explicitly tells you that it's not the type expected (and maybe because it's not loading yet).
  8. It seems that you need to read a little about functions and parameters. Hint: You're not supposing to pass a value when you declare a function, only when you run it. So you can use the same piece of code for an infinity of values. You might find simple lessons on Khan Academy that can teach you the basics about functions.
  9. It still would be easier if you provide your code. The create method is triggered after the preload method has finished its job, so anything you want to display in the create method will wait for the loading of every assets to finish. That's the point in having a dedicated Preloader state you'll see in most of the Phaser projects out there, it let you start each of the following states with all the needed assets in the cache (which is kept between states).
  10. Hi, without seeing your code I can't really do much but trying to guess: Did you load the background in the GameScreen state?
  11. Hi, I'm not the most experienced in game development out there, but if I may: 1. There seems to be nothing wrong with your approach, you might want to focus on finishing your game as first goal, which let you learn how Phaser works. 2. If it fits the project scope, you might prefer to use a very simple programming style. Otherwise, you seem to take the path towards functional programming. 3. Javascript program often uses callback functions, you might want to check that key-word. But with your actual code, showMob handles only pictures to show, and pictures don't do anything. You might want to create a mobAttack() function that uses the mobType as a parameter. Also you might want to check for Phaser.Sprites, which extends the possibility of the Phaser.Image class, with a lot of useful features for video games (like animations). 4. Update function is run by Phaser continuously, so you can totally call functions inside that 'loop', and it will be triggered each frame. You can also check how Phaser.Signals work so you can trigger functions only after particular events occurs. Keep it up!
  12. What code are you talking about? It might be useful to show it here! Can't do much more than warn you: it might happen that you will be resetting the whole group each time any of its parts gets outside of the world if you just replace the player sprite with the aliens groups in your code.
  13. raaaahman

    overlap

    ncil is right here, if the function expects a callback function, you have to use a reference to the callback function as argument. Here you're using an expression resulting from a function call. But you might also want to read this (from Phaser 2.6.2 documentation) : Also your code, you're using "coin" as a group name, which I find misleading, you better use a plural for naming groups (or arrays). Have you tried to put more than coin in the level? What happens when the player overlaps with one of them? P.S: Anyone else see the preformated code in barely legible colors (dark grey on darker grey)?
  14. For your "hot seat" mode (one device), I remember playing Heroes of Might & Magic III/V with friends and family a lot, and a simple black screen between each player's turn with a "ready" button totally did the trick. If you want to program a server for a game and you're already into javascript, Node.js could be a solution. Free Code Camp offers lessons and activities about it for free, though I didn't try it out myself so I can't tell you what it's worth. Stay motivated!
  15. It is a wild guess as I'm pretty new to Phaser myself but: You're checking overlap betweens the bounds of the waterdrop and the buildings group, not each individual buildings' bounds. My suggestion is to make a loop through your buildings, or using the "overlap" method from the Arcade Physics engine. Nice idea for a game. Cheers!