Author Topic: StarBlast Game - Latest Version (Feb. 2019)  (Read 7251 times)

0 Members and 1 Guest are viewing this topic.

Offline SirCrow

  • Forum Regular
  • Posts: 144
    • View Profile
StarBlast Game - Latest Version (Feb. 2019)
« on: February 07, 2019, 02:11:04 pm »
At last, I've uploaded the latest version of my Asteroids-inspired space-adventure game!
Most notably, this version boasts the new LASER CANNON weapons.  I think they're a lot of fun and a nice addition to the old Plasma Balls.

Please check it out here:  https://www.qb64.org/forum/index.php?topic=576.msg4272#msg4272
I may not always finish what I've started....

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: StarBlast Game - Latest Version (Feb. 2019)
« Reply #1 on: February 07, 2019, 04:55:03 pm »
Hi SirCrow,

I am getting an error from get go (see attached), beautiful graphics!

The line is 2127 actually, I moved MouseHide down and commented out FullScreen to get snapshot.
star blast error.PNG
* star blast error.PNG (Filesize: 173.63 KB, Dimensions: 813x553, Views: 227)
« Last Edit: February 07, 2019, 04:56:25 pm by bplus »

Offline STxAxTIC

  • Library Staff
  • Forum Resident
  • Posts: 1091
  • he lives
    • View Profile
Re: StarBlast Game - Latest Version (Feb. 2019)
« Reply #2 on: February 07, 2019, 05:14:45 pm »
I got an error over not having a font, I think near that same line. Removed the line, and everything ran fine afterward.

Say, SirCrow, do you want this thing moved into Samples, or are you wanting to wait for any reason? (i.e. is this close to done?)

It's great and smooth playing experience - the backgrounds and shadows add to the sense of flying quickly.
« Last Edit: February 07, 2019, 05:25:47 pm by STxAxTIC »
You're not done when it works, you're done when it's right.

Offline SirCrow

  • Forum Regular
  • Posts: 144
    • View Profile
Re: StarBlast Game - Latest Version (Feb. 2019)
« Reply #3 on: February 07, 2019, 06:41:57 pm »
I got an error over not having a font, I think near that same line. Removed the line, and everything ran fine afterward.
Say, SirCrow, do you want this thing moved into Samples, or are you wanting to wait for any reason? (i.e. is this close to done?)
It's great and smooth playing experience - the backgrounds and shadows add to the sense of flying quickly.

Thank you.  I'm glad you could correct the error. 

I thought this belonged under Programs, but if you think it should be moved, that's fine.  It's been "done" for a while now,  and I just keep adding new features and stuff.  Not exactly perfect, but pretty much finished.

By the way, are you running the EXE or do you have Linux?
« Last Edit: February 07, 2019, 06:44:20 pm by SirCrow »
I may not always finish what I've started....

Offline SirCrow

  • Forum Regular
  • Posts: 144
    • View Profile
Re: StarBlast Game - Latest Version (Feb. 2019)
« Reply #4 on: February 07, 2019, 07:21:44 pm »
Hi SirCrow,

I am getting an error from get go (see attached), beautiful graphics!

The line is 2127 actually, I moved MouseHide down and commented out FullScreen to get snapshot.

Thank you! 

So far, I have not been able to reproduce the error on my Ubuntu system.  I don't know where in my code it would happen, but it doesn't appear to be anywhere near line 2127, so that isn't much of a clue, unfortunately.  If it keeps happening, I hope someone will be able to pinpoint it eventually.

Are you running it under Windows?  I wonder if it's only the .exe that has the problem.
I may not always finish what I've started....

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: StarBlast Game - Latest Version (Feb. 2019)
« Reply #5 on: February 07, 2019, 09:06:28 pm »
Yes, I am running under Windows and used the source to compile an exe. As STxAxTIC said, it's probably a file not loading. I will dig a little.

Code: QB64: [Select]
  1.             '_FONT FMsg&: COLOR _RGB(111, 111, 111): _PRINTSTRING (125, 664), "w": _PRINTSTRING (1129, 664), "s"
  2.  
  3.  
This commented out and it runs.

I don't Windows folks have this path or file.
     
Code: QB64: [Select]
  1. FMsg& = _LOADFONT("/usr/share/fonts/truetype/liberation/LiberationSans-Bold.ttf", 24) 'Smaller font for special MESSAGES
« Last Edit: February 07, 2019, 09:16:33 pm by bplus »

Offline STxAxTIC

  • Library Staff
  • Forum Resident
  • Posts: 1091
  • he lives
    • View Profile
Re: StarBlast Game - Latest Version (Feb. 2019)
« Reply #6 on: February 07, 2019, 09:25:47 pm »
Hello SirCrow,

Yup, bplus identified the proper line. (Was using Windows for that test.)

And to clear up my poor choice of wording, I meant to ask if we should *copy* this to Samples (a highly curated section), not move it. This will immortalize your project - the Librarian will get to it soon.
« Last Edit: February 07, 2019, 09:27:53 pm by STxAxTIC »
You're not done when it works, you're done when it's right.

Offline SirCrow

  • Forum Regular
  • Posts: 144
    • View Profile
Re: StarBlast Game - Latest Version (Feb. 2019)
« Reply #7 on: February 08, 2019, 06:49:20 pm »
Hello SirCrow,

Yup, bplus identified the proper line. (Was using Windows for that test.)

And to clear up my poor choice of wording, I meant to ask if we should *copy* this to Samples (a highly curated section), not move it. This will immortalize your project - the Librarian will get to it soon.

Excellent!  I love that idea, although there's this font issue now.  I think I could use some help with making this thing work with both Windows and Linux.
Can someone tell me whether, after commenting out the problematic FONT line, you can still see the message text on-screen?  Most likely in _FONT 14, and not looking so great.  I've already taken some precautions for this possible error, but I don't know if it always does the trick.  Thanks.
I may not always finish what I've started....

Offline SirCrow

  • Forum Regular
  • Posts: 144
    • View Profile
Re: StarBlast Game - Latest Version (Feb. 2019)
« Reply #8 on: February 08, 2019, 06:58:15 pm »
Yes, I am running under Windows and used the source to compile an exe. As STxAxTIC said, it's probably a file not loading. I will dig a little.

Code: QB64: [Select]
  1.             '_FONT FMsg&: COLOR _RGB(111, 111, 111): _PRINTSTRING (125, 664), "w": _PRINTSTRING (1129, 664), "s"
  2.  
  3.  
This commented out and it runs.

I don't Windows folks have this path or file.
     
Code: QB64: [Select]
  1. FMsg& = _LOADFONT("/usr/share/fonts/truetype/liberation/LiberationSans-Bold.ttf", 24) 'Smaller font for special MESSAGES

Of course, it makes perfect sense now.  I'm using Ubuntu fonts, while Windows users will be using those ones.
Now, how do I have the prog. check for the presence of my chosen font, and then use an alternative if need be?

I wonder why this line wouldn't cause an error in Windows:
FMsg& = _LOADFONT("/usr/share/fonts/truetype/liberation/LiberationSans-Bold.ttf", 24)
I may not always finish what I've started....

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: StarBlast Game - Latest Version (Feb. 2019)
« Reply #9 on: February 08, 2019, 06:59:57 pm »
Hello SirCrow,

Yup, bplus identified the proper line. (Was using Windows for that test.)

And to clear up my poor choice of wording, I meant to ask if we should *copy* this to Samples (a highly curated section), not move it. This will immortalize your project - the Librarian will get to it soon.

Excellent!  I love that idea, although there's this font issue now.  I think I could use some help with making this thing work with both Windows and Linux.
Can someone tell me whether, after commenting out the problematic FONT line, you can still see the message text on-screen?  Most likely in _FONT 14, and not looking so great.  I've already taken some precautions for this possible error, but I don't know if it always does the trick.  Thanks.

I have not put your code through trials of tests (too many instructions for me) but when the line is commented out the program runs fine.

All that font does is print a tiny w or s, weapons or shields. The fix is simple, add the font file to the package and repath the load of it the same as all other files in package.

Quote
I wonder why this line wouldn't cause an error in Windows:
FMsg& = _LOADFONT("/usr/share/fonts/truetype/liberation/LiberationSans-Bold.ttf", 24)

I am not sure you are checking FMsg& correctly after load.
« Last Edit: February 08, 2019, 07:02:26 pm by bplus »

FellippeHeitor

  • Guest
Re: StarBlast Game - Latest Version (Feb. 2019)
« Reply #10 on: February 08, 2019, 07:00:39 pm »
Quote
I wonder why this line wouldn't cause an error in Windows:
FMsg& = _LOADFONT("/usr/share/fonts/truetype/liberation/LiberationSans-Bold.ttf", 24)
It's always good practice to check your handles. It doesn't generate an error because a failed _LOADFONT simply results in a handle equal to zero (much like a failed _LOADIMAGE returns -1). You just need to check that FMsg& > 0 before calling _FONT.
« Last Edit: February 08, 2019, 07:02:16 pm by FellippeHeitor »

Offline SirCrow

  • Forum Regular
  • Posts: 144
    • View Profile
Re: StarBlast Game - Latest Version (Feb. 2019)
« Reply #11 on: February 08, 2019, 08:14:09 pm »
Quote
I wonder why this line wouldn't cause an error in Windows:
FMsg& = _LOADFONT("/usr/share/fonts/truetype/liberation/LiberationSans-Bold.ttf", 24)
It's always good practice to check your handles. It doesn't generate an error because a failed _LOADFONT simply results in a handle equal to zero (much like a failed _LOADIMAGE returns -1). You just need to check that FMsg& > 0 before calling _FONT.

Thanks.  I checked my code and it turns out that I used
IF FMsg& > 0 THEN _FONT FMsg& ELSE _FONT 14

everywhere except the w and s location.
I may not always finish what I've started....

Offline SirCrow

  • Forum Regular
  • Posts: 144
    • View Profile
Re: StarBlast Game - Latest Version (Feb. 2019)
« Reply #12 on: February 08, 2019, 08:19:47 pm »
...
All that font does is print a tiny w or s, weapons or shields. The fix is simple, add the font file to the package and repath the load of it the same as all other files in package.

Actually, that font is used for a lot more than that.  I wish I had caught my omission of IF FMsg& > 0 THEN... before uploading.Thanks for your attention.
I may not always finish what I've started....

Offline STxAxTIC

  • Library Staff
  • Forum Resident
  • Posts: 1091
  • he lives
    • View Profile
Re: StarBlast Game - Latest Version (Feb. 2019)
« Reply #13 on: February 09, 2019, 01:36:52 am »
No worries SirCrow if bugs surface after publication - get it to where you're satisfied, and then the Librarian will immortalize this project in Samples once the dust is settled.
You're not done when it works, you're done when it's right.

Offline SirCrow

  • Forum Regular
  • Posts: 144
    • View Profile
Re: StarBlast Game - Latest Version (Feb. 2019)
« Reply #14 on: February 11, 2019, 09:48:56 pm »
No worries SirCrow if bugs surface after publication - get it to where you're satisfied, and then the Librarian will immortalize this project in Samples once the dust is settled.

I think I'm satisfied with how it works on my Ubuntu system, but I can't tell how well it runs on Windows.  For instance, I don't know how to refer to alternative fonts so that the player won't have to settle for the old _FONT 14 or similar.  For example, what would be a good Windows substitute for _LOADFONT("/usr/share/fonts/truetype/liberation/LiberationSans-Bold.ttf", 24) ?
When running under Windows, does the on-screen text look anything like the text in this screenshot?  I'd like to fix up this fonts issue very nicely, but I'll try not to worry too much about it and maybe just upload it as it is now.  Thanks.
Screenshot_SB_S2_R102_01a.gif
* Screenshot_SB_S2_R102_01a.gif (Filesize: 145.42 KB, Dimensions: 849x537, Views: 213)
« Last Edit: February 11, 2019, 10:06:05 pm by SirCrow »
I may not always finish what I've started....