• Content Count

  • Joined

  • Last visited

About SeelenGeier

  • Rank

Recent Profile Visitors

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

  1. Let me guess, your canvas is 1024x768? That is the default for Phaser if you just call "new Phaser.Game()". The headline says v3.8 but you are not using any gameConfig to initialize the game but the way it was in Phaser 2. In Phaser 3 you initialize the game with a config object instead of parameters. try this: var config = { type: Phaser.AUTO, width: 1200, height: 650 }; var game = new Phaser.Game(config);
  2. SeelenGeier

    I need some advice

    How about using a repository of your questions on a server which is used to initially download those questions. You simply make an http request and download the json from your question server and save it locally. All files that are saved locally can then be used for the game (to be able to play offline). There is no need for a database if you already have the files in a readable format. Phaser has a simple function for that: let myText = this.load.json('text123', 'assets/json/text123.json'); Docu: Otherwise Javascript can read files too but it is a bit more complicated:
  3. There is no best solution (as you might have already been told a hundred times). In the end you have to decide to either to scale the entire game, or manage different screen sizes. I would recommend trying to not scale (with the exception of retina) and try to make your UI and game elements be usable in different resolutions. For example, if you have a hidden object game, you can make a background that is much larger than the usual size of the screen. Then you simply show more background on the sides instead of scaling. The UI would always be in the corners and would just be more apart on bigger screens. This way you don't have to worry about resolutions at all which otherwise could be really troublesome.
  4. Hi everyone, I am currently working on a project that is a lot more planned out than most of my former projects. During my planning and development, I completed a profile management system which includes simple profile management, scenes, configuration as well as buttons and dialogs. It is in no way perfect or "the best way" but I put quite some effort into this and wanted to get some input from you. If anyone deems this code worthy, I would also be glad if they use this template for their own project (or as example how not to use phaser lol). This is my project repository on github: (LINK REMOVED DUE TO INVALID CODE) The Profile Management Template is inside the "pmt" folder but feel free to browse the other files as well. My current project where I use this template is in the "rbdc" folder which is also the only project using Phaser 3 instead of 2. You can check the games and Template here: (LINK REMOVED DUE TO INVALID CODE) For the workflow files you need Pencil to open them. I found that tool very handy and easy to visualize workflows. If there are any questions or improvements, feel free to comment in this thread. I don't know how much updates or if any I will provide to the Template, but for now this should be usable in its current form. Have fun SeelenGeier
  5. You want to lock your player to the box and stop its velocity.y while on the box (the box should also have no velocity.y while block.body.touching.bottom), in the callback function. Otherwise the player keeps pushing the box which eventually has enough force to push it through other objects. Check out this coding tip, especially the "locking the player" part:
  6. I only see grey textures after entering my name and signing in. It seems there are also a few errors regarding the same-origin policy. My browser is an firefox 47 right now, so maybe that's the cause (I don't have access to my home setup right now).
  7. The game is fun. For a first game this is good. Well done. If you want to improve the gameplay, you can change the amount of arrows to be more and more over time (start with a few like 3-5). Add one more with every wave. Also make the player smaller and have him grow with every wave. If he gets hit, make him smaller again. This way you have a small margin for error in the gameplay. You could also change the speed of some arrows to make them look more random. Give them a random speed (Math.random()*speedVariation + baseSpeed) when you spawn them. Codewise I would recommend you check out Phaser, which would make your projects a lot easier and does not restrict much (you can still code everything you want by hand, but Phaser helps with premade functions). You should also structure your code a bit more. Add some comments to help understand what is happening in a function. This might seem overkill in a small project but it will help a lot in bigger projects if you can make it a habit. Keep coding and change up your projects (always doing the same kind of game might bore you eventually).
  8. Simply add this line somewhere in your setup functions (I usually add it in create() ): game.canvas.oncontextmenu = function (e) { e.preventDefault(); } This will prevent the context menu from showing up and you can use the right mouse button for skills other features.
  9. I know the topic is about 2 weeks old but maybe still relevant (and sorry for digging up that other post ^^). If you only move on the x-axis, you can simply invert the velocity for by using this: player.body.velocity.x = player.body.velocity.x * -1; To flip the sprite animation when moving in the other direction, you can either have an individual animation frame for this or invert the sprite by setting the scale for its x-axis to -1. // Set Anchor to the center of your sprite yourSprite.anchor.setTo(.5,.5); // Invert scale.x to flip left/right yourSprite.scale.x *= -1; This however also inverts the width and might cause other problems (you might want to use absolute values for width and height then). See this post for examples and more insight into sprite flipping:
  10. have you tried using only one physics engine? i would assume mixing arcade and p2 either complicates a lot of things and might even cause some problems. try using arcade first and then switch to p2 if you run into arcades limits (e.g. sprite rotation). since the paddle uses p2 and the particles use arcade, they do not match. I guess that is why they do not collide.
  11. SeelenGeier


    Would arcades moveToXY() be useful to you? Otherwise if you want to simply keep them together without animations, just set the x and y for the second sprite to that of the first.
  12. Thanks for the detailed analysis. The hp bar was causing most of my bugs and I did not figure out how to fix the "first play no hp or bullets" bug. Although it works on the second load, so I didn't focus on that for now. The "redrawing" had to be done because otherwise the hp bar would constantly draw itself when I moved it, which I don't know why. I think using a graphic for the hp bar was not the best decision. At least it was causing more problems than simply using an image. I will try to work more with groups next time since I only implemented them for the draw order later.
  13. Save the starting point and then get the distance it travelled. Use the euclidian distance for this: dist((x, y), (a, b)) = √(x - a)² + (y - b)² In your case this would be: Math.sqrt(Math.pow(start.x - now.x, 2) + Math.pow(start.y - now.y, 2)) I am not sure about the formula, looks kinda off Oo. But it should be like this.
  14. I would still love to get some feedback on the game and design itself. Especially on where to improve the most. This time I tried to get the game done first so there was little focus on the code. My next game I would like to first try to do everything in Phaser with as little native javascript as possible.
  15. Could be the same issue as in your other thread. This sounds like the memory for the browser is not able to handle the game properly. There are tools that limit the amount of memory for a browser (or maybe in the settings?). Try to find out what your minimum amount of memory is you have available and try not to exceed this value during tests. If you don't want to use tools, try checking the memory usage via the task manager during your test runs. If the memory exceeds the capacity of a device, those errors occur and the game slows down.