Jump to content

Phaser.Point questions


Heppell08
 Share

Recommended Posts

Since I haven't really used points I haven't had much to say about them but upon further inspection and a bit time with them I've decided I'll try them out.

Now all I've really done with points is make them orbit a circle but I'm after more interactivity.

I want to do the following:

Group nest.

Set an image

Make a variable orbit aka move from planetA to planetB in an orbit path and vice versa.

Now which of these is allowed and which are not?

I know I can approach this differently but I like the idea of points.

Tell me how you use them or show some interesting stuff. They interest me a lot lol.

Thanks :)

Link to comment
Share on other sites

Points are mostly used for math. 

 

A sprite's position property is a point, as are a physics body's velocity and acceleration. 

 

Phaser.Point is basically rich's implementation of Vector2D. That is, you can do all kind of vector math on them and come up with some really neat stuff.

 

Here's a demo I did with phaser using vector math to create basic flocking automata: Phaser Swarm

Link to comment
Share on other sites

Yeah that kind of stuff is what I love. I'm just starting to get deeper into the math side of javascript.

I'm seeing how complex it can be with the maths since I'm using points to orbit other points like planets.

I did a an unpause code example with my point data that I'm playing with at the minute.

Is there a specific place to look at reading on using complex computational maths in code? I've looked around but keep getting pointed at math.js and don't think that's the kind of thing I need.

Nice example too, I played that a few days ago, very impressive!

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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