Page 1 of 6

Old Skool Effects & Other Stuff

Posted: Fri Nov 01, 2024 5:03 pm
by JHPJHP
Hi All,

The following is a list of 55 fun things; enjoy.
• Licenses from the original authors have been included.
• Most of the examples were conversions from other languages.
Source code cannot be shared or reposted, for personal use only.

1 : Spider Stampede *
2 & 3 : Jump Sprite
4 & 5 : Matrix and Fountain *
6 - 8 : Outline Sphere Rotate *
9 & 10 : Ray Tracing *
11 - 18 : Old Skool Kool PART 1 *
19 - 26 : Old Skool Kool PART 2 *
27 - 42 : Old Skool Kool PART 3 & 4 *
43 : Invading Space Aliens
44 : Death Star vs Asteroids
45 & 46 : Fluid Simulation
47 - 54 : Lode's Of Fun *
Bonus : Animated Goldfish

* Share the same download link.

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

Download: Spider Stampede
• I started to convert the QB64 example, but decided I could write something better using the built-in PureBasic commands.
• Some algorithms were used from the original source: https://qb64.boards.net/thread/98/explosions.

Additional Features:
1. Move the mouse cursor (crosshairs) over any spider to kill it; spiders will also kill each other.
2. Press the Spacebar to toggle Frame Rate between 30 - 60 FPS, increment by 10.
3. Press the Enter Key to take a screenshot; saved to the root folder.
4. Press the Esc Key to exit.

Image

Re: Old Skool Effects & Other Fun Stuff

Posted: Fri Nov 01, 2024 6:01 pm
by dige
Hi JHPJHP,

i've tested it with Windows PB 6.12 x86 & x64 - but there is allways only a black screen?

Re: Old Skool Effects & Other Fun Stuff

Posted: Fri Nov 01, 2024 6:20 pm
by mrbungle
Very nice! Thank you

Re: Old Skool Effects & Other Stuff

Posted: Fri Nov 01, 2024 10:57 pm
by JHPJHP
Updated: Spider_Stampede.pb
• Switched from the C-Compiler to the ASM-Compiler.
• Added a camera-flash effect when taking a screenshot.

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

Hi dige,

Thank you for posting your results.

I've looked into the example returning a black-screen and may have found a PureBasic bug, but I still need to do some testing.

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

Hi mrbungle,

You're most welcome, thank you for taking the time to post.

Re: Old Skool Effects & Other Stuff

Posted: Sat Nov 02, 2024 12:06 am
by minimy
After kill 1000 spiders (one bite me) :mrgreen:
Work perfect here in 32 and 64 bit, PB 6.01 and 6.12.
Very nice demo!! Thanks for share.

Re: Old Skool Effects & Other Stuff

Posted: Sat Nov 02, 2024 1:47 am
by BarryG
Love it! :D Thanks for posting/sharing.

Re: Old Skool Effects & Other Stuff

Posted: Sat Nov 02, 2024 10:32 am
by dige
hmm, too bad.I still see only a black screen. When I comment out #PB_Window_Invisible, I see a crosshair and spiders on a black screen.
(Running Windows 11 Pro v23H2, Nvidia RTX 2070, AMD Ryzen 7 3700X)

Re: Old Skool Effects & Other Stuff

Posted: Sat Nov 02, 2024 11:01 am
by JHPJHP
Hi minimy,

Nice job killing spiders, but you can never get them all. Thank you for testing the code.

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

Hi BarryG,

I'm glad you enjoyed my Spider Stampede example, thank you for commenting.

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

Hi dige,

I'm able to consistently reproduce the black screen using the steps below; I'll keep investigating.

If I reboot my computer, open and execute the Spider Stampede example I get a black screen, but only once. If I execute the example a second or more times, no black screen. If I reboot my computer, open PureBasic and execute another Sprite example first, then execute the Spider Stampede example second, no black screen for either example. I've done this numerous times to the same effect.

Re: Old Skool Effects & Other Stuff

Posted: Sat Nov 02, 2024 12:30 pm
by dige
It seems that DisplaySprite(#SpriteMain, 0, 0) does not work on my system.

In the debugger I can see that the sprite #SpriteMain contains the desktop image.

Could be the screen resolution of 2560 x 1440 is too high?

Re: Old Skool Effects & Other Stuff

Posted: Sat Nov 02, 2024 12:49 pm
by SPH
Black window for the post 1's code :twisted:

Re: Old Skool Effects & Other Stuff

Posted: Sat Nov 02, 2024 12:55 pm
by breeze4me
@dige
In my case, I added the line ClearScreen(RGB(0, 0, 0)) after FlipBuffers() and it looks fine.

Code: Select all

...
FlipBuffers()
ClearScreen(RGB(0, 0, 0))
...

Re: Old Skool Effects & Other Stuff

Posted: Sat Nov 02, 2024 2:22 pm
by Otrebor
@breeze4me thanks, now works here.

@JHPJHP very nice code!
Thank you!

Re: Old Skool Effects & Other Stuff

Posted: Sat Nov 02, 2024 2:39 pm
by JHPJHP
Hi dige, Otrebor,

I believe this to be an old PureBasic bug; a few years ago, some of us were having trouble with various sprite examples working with the latest version of PureBasic (at the time). I believe it was Fred who suggested we switch the compiler subsystem to directx9.

Would one of you mind downloading the code again and confirming the problem has been fixed.

Coincidentally (probably not), the examples I previously had trouble with were also full screen sprites; I'll probably post them next.

Re: Old Skool Effects & Other Stuff

Posted: Sat Nov 02, 2024 2:47 pm
by Otrebor
@JHPJHP yes, the new version works fine.
Thanks for sharing!

Re: Old Skool Effects & Other Stuff

Posted: Sat Nov 02, 2024 5:43 pm
by JHPJHP
Hi Otrebor,

Thank you, your time is appreciated.

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

Hi All,

Well, that was a bit of a rough start, but enough people seemed interested to keep going.

Download: Jump Sprite
• As was mentioned in my previous post, these were two of the full screen sprite examples that had issues before adding directx9.
• The examples were originally written because some of the games coded in PureBasic (at the time) implemented awkward jumping.

Image