Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Poly Blaster - a physics-based ball blasting game!
#1
I suddenly got the urge to dip my toe back into QB64pe for a bit of fun and put together a little physics-based game. It's based on what is now a fairly common concept but it was really enjoyable to code!

The game premise is simple. Fire balls at the polygons and destroy them before they reach the top of the screen. There are some bonus targets to pick up which perform the following -
  • Create new ball
  • Create two new balls
  • Double ball power
  • Shrink ball
  • Grow ball
Because it features lots of rotating and scaling sprites I decided to dabble with OpenGL. I should mention that I haven't touched OpenGL for many years so was basically picking it back up from scratch. The game code is a good standard but the rendering code leaves a lot to be desired! I was going to go back over it and modernise it and make it far more performant but it works fine as it is so that's a task for another day.

   
The ZIP file contains poly-blast bas along with a subfolder called assets which contains all the sound effects, graphics, etc. After building the project, the EXE must reside in the same folder as the BAS file. It accesses the assets folder relatively so won't find it if the EXE is in the wrong place.

.zip   poly-blaster.zip (Size: 143.14 KB / Downloads: 62)


You can get the latest version, report bugs, etc at GitHub where you can also find some of my other QB64pe projects (Scramble, Galaga, etc). If you have a mind to improve it (especially the OpenGL rendering) then feel free to fork and send a pull request!

Hope you enjoy!
RokCoder - dabbling in QB64pe for fun
Reply
#2
Very nice and addictive.  Smile Reminds me of Peggle.

[Image: Screenshot-2024-09-22-203551.png]

The issue with $EXEICON is strange. May have something to do with SUB _GL. I'll take a look at it when I get some time.
Reply
#3
Excellent!

May I add this game to the games section in the tutorial?
New to QB64pe? Visit the QB64 tutorial to get started.
QB64 Tutorial
Reply
#4
Looking through the code I see RokCoder mentioned that QB64pe doesn't allow fractional negative const values. (line 219)

Sure enough, I verified this. I've never noticed this before.

Is this a known issue or something new RokCoder discovered?
New to QB64pe? Visit the QB64 tutorial to get started.
QB64 Tutorial
Reply
#5
It's a recent bug and one that should be fixed in the next release, I hope.
Reply
#6
(09-22-2024, 03:20 PM)a740g Wrote: Very nice and addictive.  Smile Reminds me of Peggle.

[Image: Screenshot-2024-09-22-203551.png]

The issue with $EXEICON is strange. May have something to do with SUB _GL. I'll take a look at it when I get some time.

I LOVE PEGGLE. I beat Peggle2 on my XB360 finally. I'm playing nights now, and I bought the original I think too (I can't remember from where) LOL. Such an addictive casual game. The amount of dopamine I get when I clear a level from that epic orchestral fanfare and the growing higher and higher in pitch indicators and fireworks, just speaks to my soul Big Grin

gotta try this out. @RokCoder I'm sure this is going to be awesome!
grymmjack (gj!)
GitHubYouTube | Soundcloud | 16colo.rs
Reply
#7
(09-22-2024, 03:20 PM)a740g Wrote: Very nice and addictive.  Smile Reminds me of Peggle.

[Image: Screenshot-2024-09-22-203551.png]

The issue with $EXEICON is strange. May have something to do with SUB _GL. I'll take a look at it when I get some time.
3665 is a decent score! I think the appearance of bonus targets needs some balancing at the moment. Right now it's not very generous with extra balls, etc, as the game progresses but if it's too generous then the game goes on forever. It's a lot of fun when you have 50+ balls bouncing around the screen so it would be good to get to some happy middle ground.

As for the $EXEICON, please do let me know if you find the problem/solution. It did cross my mind that it could be GL related but I couldn't really see why that would cause a problem.
RokCoder - dabbling in QB64pe for fun
Reply
#8
(09-23-2024, 04:56 AM)grymmjack Wrote: I LOVE PEGGLE. I beat Peggle2 on my XB360 finally. I'm playing nights now, and I bought the original I think too (I can't remember from where) LOL. Such an addictive casual game. The amount of dopamine I get when I clear a level from that epic orchestral fanfare and the growing higher and higher in pitch indicators and fireworks, just speaks to my soul Big Grin

gotta try this out. @RokCoder I'm sure this is going to be awesome!
PopCap rarely put a foot wrong with their games - Peggle being an excellent example. I lost untold hours on their Plants Vs Zombies and their absolutely awesome Bookworm Adventures!

Hope you enjoy Poly Blaster if you get chance to try it!
RokCoder - dabbling in QB64pe for fun
Reply
#9
(09-22-2024, 11:34 PM)TerryRitchie Wrote: Excellent!

May I add this game to the games section in the tutorial?
You're very welcome to add it. I'd like to think that the code is pretty well structured and legible and that it's a good basis for a larger and more complex game. The OpenGL code has no place being anywhere near the word tutorial but the game code itself is fine Big Grin
RokCoder - dabbling in QB64pe for fun
Reply
#10
Woohoo!


Attached Files Image(s)
   
New to QB64pe? Visit the QB64 tutorial to get started.
QB64 Tutorial
Reply




Users browsing this thread: 1 Guest(s)