Old Skool Effects & Other Stuff

Share your advanced PureBasic knowledge/code with the community.
User avatar
JHPJHP
Addict
Addict
Posts: 2250
Joined: Sat Oct 09, 2010 3:47 am

Old Skool Effects & Other Stuff

Post 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
Last edited by JHPJHP on Sat Nov 16, 2024 9:46 pm, edited 34 times in total.

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

My PureBasic StuffFREE STUFF, Scripts & Programs.
My PureBasic Forum ➤ Questions, Requests & Comments.
dige
Addict
Addict
Posts: 1391
Joined: Wed Apr 30, 2003 8:15 am
Location: Germany
Contact:

Re: Old Skool Effects & Other Fun Stuff

Post by dige »

Hi JHPJHP,

i've tested it with Windows PB 6.12 x86 & x64 - but there is allways only a black screen?
"Daddy, I'll run faster, then it is not so far..."
mrbungle
Enthusiast
Enthusiast
Posts: 143
Joined: Wed Dec 30, 2020 3:18 am

Re: Old Skool Effects & Other Fun Stuff

Post by mrbungle »

Very nice! Thank you
User avatar
JHPJHP
Addict
Addict
Posts: 2250
Joined: Sat Oct 09, 2010 3:47 am

Re: Old Skool Effects & Other Stuff

Post 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.
Last edited by JHPJHP on Sat Nov 02, 2024 10:23 am, edited 2 times in total.

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
minimy
Enthusiast
Enthusiast
Posts: 551
Joined: Mon Jul 08, 2013 8:43 pm
Location: off world

Re: Old Skool Effects & Other Stuff

Post 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.
If translation=Error: reply="Sorry, Im Spanish": Endif
BarryG
Addict
Addict
Posts: 4118
Joined: Thu Apr 18, 2019 8:17 am

Re: Old Skool Effects & Other Stuff

Post by BarryG »

Love it! :D Thanks for posting/sharing.
dige
Addict
Addict
Posts: 1391
Joined: Wed Apr 30, 2003 8:15 am
Location: Germany
Contact:

Re: Old Skool Effects & Other Stuff

Post 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)
"Daddy, I'll run faster, then it is not so far..."
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 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.
Last edited by JHPJHP on Sun Nov 03, 2024 4:42 pm, edited 5 times in total.

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

My PureBasic StuffFREE STUFF, Scripts & Programs.
My PureBasic Forum ➤ Questions, Requests & Comments.
dige
Addict
Addict
Posts: 1391
Joined: Wed Apr 30, 2003 8:15 am
Location: Germany
Contact:

Re: Old Skool Effects & Other Stuff

Post 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?
"Daddy, I'll run faster, then it is not so far..."
User avatar
SPH
Enthusiast
Enthusiast
Posts: 561
Joined: Tue Jan 04, 2011 6:21 pm

Re: Old Skool Effects & Other Stuff

Post by SPH »

Black window for the post 1's code :twisted:

!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Portable LENOVO ideapad 110-17ACL 64 bits
Version de PB : 6.12LTS - 64 bits
breeze4me
Enthusiast
Enthusiast
Posts: 633
Joined: Thu Mar 09, 2006 9:24 am
Location: S. Kor

Re: Old Skool Effects & Other Stuff

Post 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))
...
User avatar
Otrebor
Enthusiast
Enthusiast
Posts: 210
Joined: Mon Mar 17, 2014 1:42 pm
Location: São Paulo, Brasil
Contact:

Re: Old Skool Effects & Other Stuff

Post by Otrebor »

@breeze4me thanks, now works here.

@JHPJHP very nice code!
Thank you!
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 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.
Last edited by JHPJHP on Sat Nov 02, 2024 11:14 pm, edited 8 times in total.

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
Otrebor
Enthusiast
Enthusiast
Posts: 210
Joined: Mon Mar 17, 2014 1:42 pm
Location: São Paulo, Brasil
Contact:

Re: Old Skool Effects & Other Stuff

Post by Otrebor »

@JHPJHP yes, the new version works fine.
Thanks for sharing!
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 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
Last edited by JHPJHP on Sat Nov 16, 2024 9:47 pm, edited 9 times in total.

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

My PureBasic StuffFREE STUFF, Scripts & Programs.
My PureBasic Forum ➤ Questions, Requests & Comments.
Post Reply