Jump to content

Simple game - please help me choose right tools


Recommended Posts

I'm planning to develop a simple HTML5/Phaser game. The idea seems very simple but I'm not sure if my choice of tools is right the goal of a game is to draw a given shape as precise as possible. So for example we have a star which is moving alowly to make things a little bit more challenging and player need to draw a line around it as close to its edges as possible. The farther they draw from the edges the lesser points they get. Visualisation below


So I thought that I should a physics engine for this to detect collision with the body of this shape and since shapes will be very different and complicated I cannot use Arcade for this. So i though about P2 physics but isn't that overkill for such a simple game? Maybe there's simpler and more efficient solutions to achieve the desired effect? Any advice will be appreciated:)

Link to comment
Share on other sites

Hi. Here is an example of something you could use using arcade physics:

The idea is to first draw any primitive shape you like using bitmapData and interpolation. The shapeData array can be modified to create any shape you like. Then in your plot function you evenly distribute dots (with physics) along your shape. Then you create three to four "mouseBodies" that follow your mouse and collide with the dots. this way you can determine how far off you are from the actual shape. The collision checks are then done and based upon which "mouseBody" is colliding, so you add or even subtract score (see example). Notice that the trail is drawn using rendertextures (example), but this is certainly not a must. You can also draw your mouse trail using graphics. You could also stick to rendertextures, but make your own sprite (simple gradient circle made in photoshop, 64x64) and replace it with the gameboy. You will probably have a nice looking cloud trail. A final note, the actual primitive shape can also be drawn as a polygon using graphics. These are all implementation details, but maybe it will give you more ideas for your own game...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...