Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help,
read this.
-
Ref
- Party member
- Posts: 702
- Joined: Wed May 02, 2012 11:05 pm
Post
by Ref »
Simple. With orbit center (cx,cy), orbit radii (rx,ry) and angle, calculate the new location of the object.
Code: Select all
function orbit( cx, cy, rx, ry, an )
local x = rx * math.cos( an ) + cx
local y = ry * math.sin( an ) + cy
return x, y
end
-
Attachments
-
- pushless.love
- Once again an example
- (257.33 KiB) Downloaded 83 times
-
Ref
- Party member
- Posts: 702
- Joined: Wed May 02, 2012 11:05 pm
Post
by Ref »
If you want to use push and pop, this might help you????
-
Attachments
-
- pushpop.love
- (678 Bytes) Downloaded 74 times
-
Miawwe
- Prole
- Posts: 3
- Joined: Mon Apr 10, 2017 6:52 pm
Post
by Miawwe »
Could you please make me example with 2 planets that rotate on different speeds please? xd I really still don't know how you use that push and pop.
-
Ref
- Party member
- Posts: 702
- Joined: Wed May 02, 2012 11:05 pm
Post
by Ref »
As per your request.
Best
-
Attachments
-
- PushAndPop.love
- Two planet demo
- (498 Bytes) Downloaded 79 times
Users browsing this forum: Bing [Bot], Google [Bot] and 4 guests