- Endless loop -

Development notes of Construct 2's plugins

Showing posts with label distance. Show all posts
Showing posts with label distance. Show all posts

Get angle and distance between two points

Distance
var distance = cr.distanceTo(px0, py0, px1, py1);


Angle
var angle = cr.angleTo(px0, py0, px1, py1);      // in radian
angle = cr.to_clamped_degrees(angle);     // radian to degree
No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
標籤: angle, cr, distance
Older Posts Home
Subscribe to: Posts (Atom)

Search This Blog

Links

  • Plugin SDK
  • Source code

Total Pageviews

Labels

Instance (6) ACE (4) cr (2) Behavior instance (1) CocoonJS (1) Eval (1) SID (1) UID (1) angle (1) destroy (1) distance (1) engine (1) layer (1) object-type (1) timeline (1) timescale (1)

Hot spots

  • Reuse ACE
  • Get UID from instance, get instance from UID
  • Procedure of plugins and event sheet in each tick
  • Reuse system action
  • Get behavior instance
  • Get SID from object-type, get object-type from SID
  • Create instance
  • Destroy children objects when parent object destroyed
  • Override common ACEs of object

Blog Archive

  • ►  2014 (15)
    • ►  2 (11)
    • ►  3 (1)
    • ►  4 (1)
    • ►  5 (1)
    • ►  9 (1)
  • ►  2015 (1)
    • ►  3 (1)
  • ▼  2016 (1)
    • ▼  2 (1)
      • Destroy children objects when parent object destroyed
Simple theme. Powered by Blogger.