Swinging ropes in games
Swinging ropes in games
Maybe we could talk more about programming tricks
So some games have swinging ropes forth and back like here:
On Spectrum the obvious example is Jet Set Willy engine:
So how do you implement such rope in your code? Is it a complicated stuff involving math, sines and cosines or is there some trick to do it in a simple way?
I suppose the lame way is to make the rope a straight line but it seems that most game do better than that.
So some games have swinging ropes forth and back like here:
On Spectrum the obvious example is Jet Set Willy engine:
So how do you implement such rope in your code? Is it a complicated stuff involving math, sines and cosines or is there some trick to do it in a simple way?
I suppose the lame way is to make the rope a straight line but it seems that most game do better than that.
Re: Swinging ropes in games
To be honest I never think of that till now but I agree it must be a difficult thing to implement even a regular repeating arc movement.
I guess the follow up question would be, could the rope movement have an irregular arc, deformation?
I guess the follow up question would be, could the rope movement have an irregular arc, deformation?
Re: Swinging ropes in games
Website: Tardis Remakes / Mostly remakes of Arcade and ZX Spectrum games.
My games for the Spectrum: Dingo, The Speccies, The Speccies 2, Vallation & Sqij.
Twitter: Sokurah
My games for the Spectrum: Dingo, The Speccies, The Speccies 2, Vallation & Sqij.
Twitter: Sokurah
Re: Swinging ropes in games
Ah yeah, Hunchback did that didn't it?
Of course there's always Juan's favourite, Jungle Fever...
My Speccy site: thirdharmoniser.com
- MatGubbins
- Dynamite Dan
- Posts: 1239
- Joined: Mon Nov 13, 2017 11:45 am
- Location: Kent, UK
Re: Swinging ropes in games
Jack The Nipper 2 - coconut capers- has a very nice rope to swing on
Re: Swinging ropes in games
The JSW rope has a kink in it, so the movement isn't completely right.Sokurah wrote: ↑Wed Feb 14, 2018 11:09 am Here's how it was done in Jet Set Willy;
http://www.oocities.org/andrewbroad/spe ... #jsw-ropes
Re: Swinging ropes in games
I wasn't suggesting you should copy the code - just look at how it was done and perhaps come up with a new similar way.
Website: Tardis Remakes / Mostly remakes of Arcade and ZX Spectrum games.
My games for the Spectrum: Dingo, The Speccies, The Speccies 2, Vallation & Sqij.
Twitter: Sokurah
My games for the Spectrum: Dingo, The Speccies, The Speccies 2, Vallation & Sqij.
Twitter: Sokurah
- Juan F. Ramirez
- Bugaboo
- Posts: 5135
- Joined: Tue Nov 14, 2017 6:55 am
- Location: Málaga, Spain
Re: Swinging ropes in games
Thanks for that link.
So Matthew Smith is using some precalculated table for the points makeing the rope. Actually I could guess it.
So Matthew Smith is using some precalculated table for the points makeing the rope. Actually I could guess it.
Re: Swinging ropes in games
Ah, it's not the point positions. It's the offset from the point immediately above. So you start at the top point, then the next point is +0 horizontally, +6 downwards, and so on through the table until you've plotted enough points.
Then if you start a little bit later in the table, so a little offset sneaks in at the bottom, and that works its way up to the top until the whole chain of points is offset to one side or the other.
And since it's a table, a random bit of wobblyness can be added that appears to ripple up then back down the rope near the end of the swing.
Then if you start a little bit later in the table, so a little offset sneaks in at the bottom, and that works its way up to the top until the whole chain of points is offset to one side or the other.
And since it's a table, a random bit of wobblyness can be added that appears to ripple up then back down the rope near the end of the swing.
Re: Swinging ropes in games
A reference Lookup table would be the obvious choice, for performance concerns.
Re: Swinging ropes in games
Egghead Goes to Town used a big table of coordinates for speed, all pre-calculated in Sinclair BASIC. It was quite expensive but seeing as the screens were very efficiently stored I figured it was affordable.
Not on Twitter, left the Spectrum scene on 4th December 2018. Thanks folks, it was a pleasure knowing you.
http://www.spanglefish.com/egghead/
http://arcadegamedesigner.proboards.com/
https://jonathan-cauldwell.itch.io/
http://www.spanglefish.com/egghead/
http://arcadegamedesigner.proboards.com/
https://jonathan-cauldwell.itch.io/
Re: Swinging ropes in games
There's a flaw somewhere though, you've gone against Spectrum best practise by not having a rope with 75% unfair collision.
Re: Swinging ropes in games
Wow, calculating data in Spectrum Basic in 2017 is certainly retroEgghead Goes to Town used a big table of coordinates for speed, all pre-calculated in Sinclair BASIC
Personally when I needed once some precalculated data for my game, I used Excel. Not very cool, I suppose
By the way, welcome to the forums, Jonathan !