Old Skool Effects & Other Stuff

Share your advanced PureBasic knowledge/code with the community.
User avatar
IceSoft
Addict
Addict
Posts: 1682
Joined: Thu Jun 24, 2004 8:51 am
Location: Germany

Re: Old Skool Effects & Other Stuff

Post by IceSoft »

@Mr.L looks great!
Changing the drawing order makes the shadow more realistic:

Code: Select all

    CreateGear(83,   74, 20, 6, -1, RGBA(192, 192, 192, 255))
    CreateGear(-10, 518, 40, 5,  1, RGBA(170, 169, 173, 255))
    CreateGear(215, 240, 15, 2,  1, RGBA(176, 196, 222, 255))
    CreateGear(485, 220, 30, 1, -1, RGBA(205, 127,  50, 255))
    CreateGear(234, 372,  7, 4, -1, RGBA(184, 115,  51, 255))   
    CreateGear(746, 414, 24, 3,  1, RGBA(205, 127,  50, 255))
    CreateGear(705,  93, 12, 7,  1, RGBA(230, 232, 250, 255))
A better solution will be:
1. Draw all shadows first
2. Draw the gears now
Belive! C++ version of Puzzle of Mystralia
<Wrapper>4PB, PB<game>, =QONK=, PetriDish, Movie2Image, PictureManager,...
User avatar
moulder61
Enthusiast
Enthusiast
Posts: 188
Joined: Sun Sep 19, 2021 6:16 pm
Location: U.K.

Re: Old Skool Effects & Other Stuff

Post by moulder61 »

@JHPJHP

Thanks for all the examples, they're very nice. I'm hoping to learn from them somehow. Maybe borrow some ideas? 8)

@Mr.L

Nice work as usual. :D

@IceSoft

I can see what you mean about the shadows, but I have to disagree somewhat. I just thought it looked like some gears were taller than others? Your modification looks pretty good too. :wink:
"If it ain't broke, fix it until it is!

This message is brought to you thanks to SenselessComments.com

My PB stuff for Linux: "https://u.pcloud.link/publink/show?code ... z3MR0T3jyV
Mr.L
Enthusiast
Enthusiast
Posts: 146
Joined: Sun Oct 09, 2011 7:39 am

Re: Old Skool Effects & Other Stuff

Post by Mr.L »

moulder61 wrote: Thu Nov 14, 2024 1:27 pm I just thought it looked like some gears were taller than others?
exactly my thoughts too :D
User avatar
moulder61
Enthusiast
Enthusiast
Posts: 188
Joined: Sun Sep 19, 2021 6:16 pm
Location: U.K.

Re: Old Skool Effects & Other Stuff

Post by moulder61 »

@Mr.L

I stripped a few gearboxes down, back in the day. Your gears look pretty authentic to me. :D

Moulder. (Member of the MrL. fan club. :P )
"If it ain't broke, fix it until it is!

This message is brought to you thanks to SenselessComments.com

My PB stuff for Linux: "https://u.pcloud.link/publink/show?code ... z3MR0T3jyV
User avatar
JHPJHP
Addict
Addict
Posts: 2250
Joined: Sat Oct 09, 2010 3:47 am

Re: Old Skool Effects & Other Stuff

Post by JHPJHP »

To those who posted their appreciation for my examples, you are most welcome.

While I took a week or so to post 55 examples they took considerably longer to write, especially since the original sources were written in multiple languages... when it wasn't frustrating it was fun, and when it was finished it was satisfying.

I hope more people take a cue from Mr.L and his reimagining of the rotating gears example; nice job.

If you're not investing in yourself, you're falling behind.

My PureBasic StuffFREE STUFF, Scripts & Programs.
My PureBasic Forum ➤ Questions, Requests & Comments.
User avatar
moulder61
Enthusiast
Enthusiast
Posts: 188
Joined: Sun Sep 19, 2021 6:16 pm
Location: U.K.

Re: Old Skool Effects & Other Stuff

Post by moulder61 »

@JHPJHP

I just tried the Jump Sprite code before noticing the earlier comment about putting ClearScreen() in after FlipBuffers(). I figured it out for myself anyway, so instead, I'll mention the way the dude's hands move as he's walking. It's little details like that that I appreciate. Nice work by whoever designed it? :wink:

Moulder.
"If it ain't broke, fix it until it is!

This message is brought to you thanks to SenselessComments.com

My PB stuff for Linux: "https://u.pcloud.link/publink/show?code ... z3MR0T3jyV
User avatar
JHPJHP
Addict
Addict
Posts: 2250
Joined: Sat Oct 09, 2010 3:47 am

Re: Old Skool Effects & Other Stuff

Post by JHPJHP »

Hi moulder61,

Thank you for letting me know that clearing the buffer (ClearScreen / FlipBuffers) was needed for it to work on Linux.
• Originally reported by breeze4me, but at the time I thought we were dealing with a Windows only problem.
• Since losing my virtual drive two years ago, I've only had access to Windows, so testing has been limited.

The hand movements from the sprite sheet I downloaded; unfortunately, I can't take credit for those little details.

If you're not investing in yourself, you're falling behind.

My PureBasic StuffFREE STUFF, Scripts & Programs.
My PureBasic Forum ➤ Questions, Requests & Comments.
User avatar
IceSoft
Addict
Addict
Posts: 1682
Joined: Thu Jun 24, 2004 8:51 am
Location: Germany

Re: Old Skool Effects & Other Stuff

Post by IceSoft »

IceSoft wrote: Thu Nov 14, 2024 12:58 pm A better solution will be:
1. Draw all shadows first
2. Draw the gears now
Here the code snippet which have to change for a full 2D look on rotating gears:

Code: Select all

			ForEach Gears()
				With Gears()
					RotateSprite(\sprite, currentAngle * \rotationSpeed, #PB_Absolute)
					DisplayTransparentSprite(\sprite, \positionX + 15, \positionY + 15, 64, 0) ; shadow
				EndWith
			Next
			ForEach Gears()
				With Gears()
					DisplayTransparentSprite(\sprite, \positionX, \positionY)
				EndWith
			Next
There are also some "nice" gears puzzle on the web.
Maybe somebody want make also a gears game?
Belive! C++ version of Puzzle of Mystralia
<Wrapper>4PB, PB<game>, =QONK=, PetriDish, Movie2Image, PictureManager,...
User avatar
moulder61
Enthusiast
Enthusiast
Posts: 188
Joined: Sun Sep 19, 2021 6:16 pm
Location: U.K.

Re: Old Skool Effects & Other Stuff

Post by moulder61 »

JHPJHP wrote: Fri Nov 15, 2024 3:12 am Hi moulder61,

Thank you for letting me know that clearing the buffer (ClearScreen / FlipBuffers) was needed for it to work on Linux.

The hand movements from the sprite sheet I downloaded; unfortunately, I can't take credit for those little details.
Sorry I originally neglected to mention I was running it in Linux. I don't know if it's a graphics card issue or just the fact that it needs to have the screen cleared when using any kind of sprite based code, but that happens a lot for me, so I knew how to get around it. See the before and after pictures below.

Example 2 of JumpSprite doesn't work for me because of a compiler error. The following subsystem cannot be found: directx9. (Obviously, if I'm using Linux!)

I also assumed wrongly that you had designed the animation yourself, so kudos to whoever did it originally?

Moulder.

Image

Image
"If it ain't broke, fix it until it is!

This message is brought to you thanks to SenselessComments.com

My PB stuff for Linux: "https://u.pcloud.link/publink/show?code ... z3MR0T3jyV
AZJIO
Addict
Addict
Posts: 2141
Joined: Sun May 14, 2017 1:48 am

Re: Old Skool Effects & Other Stuff

Post by AZJIO »

Fractals are grainy. I downloaded from here, it worked more clearly.
User avatar
JHPJHP
Addict
Addict
Posts: 2250
Joined: Sat Oct 09, 2010 3:47 am

Re: Old Skool Effects & Other Stuff

Post by JHPJHP »

Hi moulder61,

Thank you for the additional information.
moulder61 wrote:Example 2 of JumpSprite doesn't work for me because of a compiler error. The following subsystem cannot be found: directx9.
Remove directx9 from: [ Menu ] > Compiler > Compiler Options... > Library Subsystem:

-----------------------------------

I'm sure most of you who have download the examples have also read the information provided in each post:

Julia Effect & Mandelbrot Effect:
Updating the code to increase window size will improve pixelation but slow down animations.
• While the Maximize Window Button won't improve pixelation it will improve the overall experience.

NOTE: The Lode examples were intentionally sized small to improve the speed of the effects.

If you're not investing in yourself, you're falling behind.

My PureBasic StuffFREE STUFF, Scripts & Programs.
My PureBasic Forum ➤ Questions, Requests & Comments.
User avatar
moulder61
Enthusiast
Enthusiast
Posts: 188
Joined: Sun Sep 19, 2021 6:16 pm
Location: U.K.

Re: Old Skool Effects & Other Stuff

Post by moulder61 »

Hi JHPJHP,

Removing directx9 helped but it still needed the ClearScreen(0) after FlipBuffers().

I haven't tried all your examples yet, but the JumpSprite ones are very nice. Thanks.

Moulder.
"If it ain't broke, fix it until it is!

This message is brought to you thanks to SenselessComments.com

My PB stuff for Linux: "https://u.pcloud.link/publink/show?code ... z3MR0T3jyV
Post Reply