Double pendulum

Show off your games, demos and other (playable) creations.
User avatar
darkfrei
Party member
Posts: 1168
Joined: Sat Feb 08, 2020 11:09 pm

Double pendulum

Post by darkfrei »

Hi all!

Here is my try to make a double pendulum (thanks for reddit):
Attachments
2021-05-08T00_53_47-Untitled.png
2021-05-08T00_53_47-Untitled.png (239.59 KiB) Viewed 8777 times
double-pendulum-01.love
(1.15 KiB) Downloaded 256 times
:awesome: in Lua we Löve
:awesome: Platformer Guide
:awesome: freebies
User avatar
darkfrei
Party member
Posts: 1168
Joined: Sat Feb 08, 2020 11:09 pm

Re: Double pendulum

Post by darkfrei »

Second version:

Draw with lines, not points.

Press space to start.
Attachments
2021-05-08T17_35_15-Untitled.png
2021-05-08T17_35_15-Untitled.png (59.42 KiB) Viewed 8733 times
double-pendulum-02.love
(1.19 KiB) Downloaded 248 times
:awesome: in Lua we Löve
:awesome: Platformer Guide
:awesome: freebies
User avatar
darkfrei
Party member
Posts: 1168
Joined: Sat Feb 08, 2020 11:09 pm

Re: Double pendulum

Post by darkfrei »

The third version: 10000 double pendulums, on start the difference is just (1/1000000) radians and it makes big difference after few seconds.

Many thanks to Alexander Gustafsson: https://www.youtube.com/watch?v=H7nMP-MYyIc
Attachments
2021-05-08T22_32_51-Untitled.png
2021-05-08T22_32_51-Untitled.png (601.76 KiB) Viewed 8715 times
double-pendulum-03.love
(974 Bytes) Downloaded 249 times
:awesome: in Lua we Löve
:awesome: Platformer Guide
:awesome: freebies
User avatar
darkfrei
Party member
Posts: 1168
Joined: Sat Feb 08, 2020 11:09 pm

Re: Double pendulum

Post by darkfrei »

Version 04:

red-green-blue gradient:

Code: Select all

function value_to_color (t, alpha) -- value from 0 (red) to 1 (blue)
	local r = 2-4*t
	local g = t < 1/2 and 4*t or 4-4*t
	local b = -2 + 4*t
	return {r,g,b,alpha}
end
You can enable/disable points (circles) and lines with keys Z and X.
Attachments
2021-05-11T16_26_38-Untitled.png
2021-05-11T16_26_38-Untitled.png (118.18 KiB) Viewed 8601 times
2021-05-11T16_36_43-Untitled.png
2021-05-11T16_36_43-Untitled.png (48.34 KiB) Viewed 8601 times
double-pendulum-04.love
(1.29 KiB) Downloaded 224 times
:awesome: in Lua we Löve
:awesome: Platformer Guide
:awesome: freebies
User avatar
Gunroar:Cannon()
Party member
Posts: 1085
Joined: Thu Dec 10, 2020 1:57 am

Re: Double pendulum

Post by Gunroar:Cannon() »

This all looks really great and fancy! Any possible uses in gamedev or is it just like a test/implementation?
The risk I took was calculated,
but man, am I bad at math.

-How to be saved and born again :huh:
User avatar
darkfrei
Party member
Posts: 1168
Joined: Sat Feb 08, 2020 11:09 pm

Re: Double pendulum

Post by darkfrei »

Gunroar:Cannon() wrote: Tue May 11, 2021 5:26 pm This all looks really great and fancy! Any possible uses in gamedev or is it just like a test/implementation?
Just proof of concept, but such pendulum can be used on the game level as a help to the exit or like a boss. Just put the disc saw on the free end of this pendulum >:)
:awesome: in Lua we Löve
:awesome: Platformer Guide
:awesome: freebies
User avatar
Gunroar:Cannon()
Party member
Posts: 1085
Joined: Thu Dec 10, 2020 1:57 am

Re: Double pendulum

Post by Gunroar:Cannon() »

darkfrei wrote: Tue May 11, 2021 7:57 pm
Just proof of concept, but such pendulum can be used on the game level as a help to the exit or like a boss. Just put the disc saw on the free end of this pendulum >:)
:ultrahappy: Hahah!! I see!
The risk I took was calculated,
but man, am I bad at math.

-How to be saved and born again :huh:
User avatar
darkfrei
Party member
Posts: 1168
Joined: Sat Feb 08, 2020 11:09 pm

Re: Double pendulum

Post by darkfrei »

Gunroar:Cannon() wrote: Wed May 12, 2021 9:39 am
darkfrei wrote: Tue May 11, 2021 7:57 pm
Just proof of concept, but such pendulum can be used on the game level as a help to the exit or like a boss. Just put the disc saw on the free end of this pendulum >:)
:ultrahappy: Hahah!! I see!
Pretty hard game, level 6 is very difficult.
Attachments
2021-05-14T00_05_01-Double Pendulum Jump Game.png
2021-05-14T00_05_01-Double Pendulum Jump Game.png (171.17 KiB) Viewed 8399 times
double-pendulum-jump-game-02.love
(3.69 KiB) Downloaded 302 times
:awesome: in Lua we Löve
:awesome: Platformer Guide
:awesome: freebies
User avatar
Gunroar:Cannon()
Party member
Posts: 1085
Joined: Thu Dec 10, 2020 1:57 am

Re: Double pendulum

Post by Gunroar:Cannon() »

Level 6 is very difficult??! I just got past level 2 after 117 deaths!!
But I really like the game, haha, it was fun. The mean balls toturing the little bunny rabit. Now I really see!!!!
The risk I took was calculated,
but man, am I bad at math.

-How to be saved and born again :huh:
User avatar
darkfrei
Party member
Posts: 1168
Joined: Sat Feb 08, 2020 11:09 pm

Re: Double pendulum

Post by darkfrei »

Gunroar:Cannon() wrote: Fri May 14, 2021 11:43 am Level 6 is very difficult??! I just got past level 2 after 117 deaths!!
But I really like the game, haha, it was fun. The mean balls toturing the little bunny rabit. Now I really see!!!!
My try up to level 4:


How to insert the embed youtube video?
Last edited by darkfrei on Fri May 14, 2021 10:15 pm, edited 1 time in total.
:awesome: in Lua we Löve
:awesome: Platformer Guide
:awesome: freebies
Post Reply

Who is online

Users browsing this forum: No registered users and 12 guests