QB64.org Forum

Active Forums => Programs => Topic started by: TerryRitchie on February 05, 2020, 11:13:16 pm

Title: Vector Library and WideScreen Asteroids
Post by: TerryRitchie on February 05, 2020, 11:13:16 pm
---------------------------------------
UPDATE 02/11/20 9:21PM EST
Updated the .ZIP file below again. I made it to level 12 and ... crash. Found the bug and fixed it. The maximum asteroids that can ever be on the screen at once in a perfect scenario is 64 (16 large asteroids times 4 small asteroids). I set the asteroids array to 63 when it should have been 64. Oops.
---------------------------------------
UPDATE 02/07/20 3:15PM EST
The .ZIP has again been updated. The Button function has been completely rewritten to use the vector library's ObjPrint vector text command instead. _PRINTSTRING is just way too resource heavy to be used in real-time menus. Also made a few more efficiency changes. No matter how many objects on the screen now the drop down menu does not slow anything down.
---------------------------------------
UPDATE 02/06/20 11:15PM EST
I updated the .ZIP file below with a bug fixed and some inefficiencies in the collision routines I corrected. I also removed the pre-compiled .EXE to make the .ZIP file smaller.
---------------------------------------

Sorry I have been away for so long but I come bearing gifts :-)

I had to put the Sprite library on the back-burner because of unforeseen problems I encountered with it. Because of that I decided to step away from programming for a bit. When I got my head on straight again I decided to write a vector library. Of course I need to write a game to prove the library so I wrote Widescreen Asteroids.

Widescreen Asteroids is not a clone. It's what I always wanted in an Asteroids game. It's very close to the original with a few enhancements. The vector engine is fast so the game is filled with particle effects and, of course, asteroids. I hope you'll like the game. Please report any bugs or errors you find in the game.

I don't have documentation written yet for the vector library. Below is a crude listing of commands that it supports. I'll have the documentation finished soon.

The ZIP file contains everything needed to run and compile the game. It contains a pre-compiled .EXE so you can run the game right away if you wish. If you prefer to compile yourself simply delete "asteroids.exe".

--- CRUDE COMMAND LISTING FOR VECTOR LIBRARY ---

Sub         ObjActive   ObjID, Flag               Sets the active value of an object
Sub         ObjAngle   ObjID, Angle            Set the angle of an object
Sub         ObjBind      ObjID, X1, Y1, X2, Y2, Mode   Set the minimum X and Y coordinates allowed for object
Sub         ObjColor   ObjID, Lnumber, Clr         Set or reset the color for one or all line segments within an object
Sub         ObjDraw      ObjID                  Draw an object to the screen
Sub         ObjFriction   ObjID, Friction            Set the friction amount for an object
Sub         ObjInit                           Initialize variables for object library
Sub         ObjLines   ObjID                  Get all line info from an object at current angle (INTERNAL USE ONLY)
Sub         ObjMove      ObjID                  Update an object's position based on all current values
Sub         ObjPrint   tx, tx, Text, Scale, Clr   Print vector text at the coordinates specified
Sub         ObjPush      ObjID, Force            Push an object in its current direction
Sub         ObjPut      ObjID, X, Y               Set the X,Y coordinates of an object
Sub         ObjRotate   ObjID, Angle, Mode         Rotate an object to either absolute or relative angle, or auto rotate
Sub         ObjScale   ObjID, Scale            Set the X and Y scale of an object
Sub         ObjScaleX   ObjID, Scale            Set the X scale of an object
Sub         ObjScaleY   ObjID, Scale            Set the Y scale of an object
Sub         ObjStamp   ObjID, x, y, Angle, Scale, Clr   Place a copy of an object on-screen
Sub         ObjVectorX   ObjID, XV               Set the X vector value for an object
Sub         ObjVectorY   ObjID, YV               Set the Y vector value for an object

Function   ObjActive   ObjID                  Get the active value of an object
Function   ObjAngle   ObjID                  Get current angle of object
Function    ObjAngleO2O   ObjID1, ObjID1            Get the angle between two object center points
Function   ObjAngleP2P   x1, y1, x2, y2            Get the angle between two X,Y coordinate pairs
Function   ObjBoxHit   ObjID1, ObjID2            Return TRUE if two objects touching via bounding boxes
Function   ObjColor   ObjID, Lnumber            Get color of line within object
Function   ObjDistO2O   ObjID1, ObjID2            Get distance between center point of two objects
Function   ObjDistP2P   x1, y1, x2, y2            Get distance between two X,Y coordinate pairs
Function   ObjFixAngle   Angle                  Return the angle passed in from 0 to 360
Function   ObjFriction   ObjID                  Get current friction of object
Function   ObjHeight   ObjID                  Get current height of object
Function   ObjIntersect   p1x, p1y, q1x, q1y, p2x, p2y, q2x, q2y   Return TRUE if two line segments are intersecting
Function   ObjLineHit   ObjID, p2x, p2y, q2x,q2y   Return TRUE if a line segment is touching an object
Function   ObjLoad      File                  Load an object file into memory
Function   ObjObjectHit   ObjID1, ObjID2         Return TRUE if any line segments in two objects touch
Function   ObjMake      ObjID                  Make an object from objects in memory
Function   ObjMax      n1, n2                  Return the largest of two numbers
Function   ObjMaxX      ObjID                  Get maximum X coordinate allowed for object
Function   ObjMaxY      ObjID                  Get maximum Y coordinate allowed for object
Function   ObjMin      n1, n2                  Return the smallest of two numbers
Function   ObjMinX      ObjID                  Get minimum X coordinate allowed for object
Function   ObjMinY      ObjID                  Get minimum Y coordinate allowed for object
Function   ObjNCosine   Angle                  Get the cosine value of a negative angle
Function   ObjNSine   Angle                  Get the sine value of a negative angle
Function   OBJPCosine   Angle                  Get the cosine value of a positive angle
Function   ObjPSine   Angle                  Get the since value of a positive angle
Function   ObjRadius   ObjID                  Get current radius of object
Function   ObjRadiusHit   ObjID1, ObjID2         Return TRUE if two objects touching via radii distance
Function   ObjScale   ObjID                  Get scale of object if X and Y scales are the same, otherwise -1
Function   ObjScaleX   ObjID                  Get X scale of object
Function   ObjScaleY   ObjID                  Get Y scale of object
Function   ObjSpeed   ObjID                  Get current speed of object
Function   ObjVectorX   ObjID                  Get current X vector of object
Function   ObjVectorY   ObjID                  Get current Y vector of object
Function   ObjX      ObjID                  Get current X coordinate of object
Function   ObjX1      ObjID, Lnumber            Get start X coordinate of line within object
Function   ObjX2      ObjID, Lnumber            Get end X coordinate of line within object
Function   ObjY      ObjID                  Get current Y coordinate of object
Function   ObjY1      ObjID, Lnumber            Get start Y coordinate of line within object
Function   ObjY2      ObjID, Lnumber            Get end Y coordinate of line within object
Fucntion   ObjWidth   ObjID                  Get current width of object
Function   onSegment   p, q, r                  Return TRUE if point q lies on line segment pr (INTERNAL USE ONLY)
Function   Orientation   p, q, r                  Returns orientation of ordered triplet pair (INTERNAL USE ONLY)
Title: Re: Vector Library and WideScreen Asteroids
Post by: STxAxTIC on February 05, 2020, 11:22:59 pm
This is very smooth, thanks for sharing!

(I like anything with the word vector in it, will be having a look under the hood!)

My only question - so where's the time machine? Today's date being the 5th!

Code: QB64: [Select]
  1. '                            Terry Ritchie
  2. '                         February 10th, 2020
  3. '                             QB64 V1.3
Title: Re: Vector Library and WideScreen Asteroids
Post by: keybone on February 05, 2020, 11:26:00 pm
This is awesome! Now I found out what I'm gonna be doing for the rest of the night. :-)
Title: Re: Vector Library and WideScreen Asteroids
Post by: TerryRitchie on February 05, 2020, 11:31:58 pm
This is very smooth, thanks for sharing!

(I like anything with the word vector in it, will be having a look under the hood!)

My only question - so where's the time machine? Today's date being the 5th!

Code: QB64: [Select]
  1. '                            Terry Ritchie
  2. '                         February 10th, 2020
  3. '                             QB64 V1.3

Oops :-) I changed January to February but forgot about the day.
Title: Re: Vector Library and WideScreen Asteroids
Post by: bplus on February 05, 2020, 11:49:24 pm
Hey welcome back!
Title: Re: Vector Library and WideScreen Asteroids
Post by: TerryRitchie on February 06, 2020, 12:33:55 am
Hey welcome back!

Thank you :-)
Title: Re: Vector Library and WideScreen Asteroids
Post by: TerryRitchie on February 06, 2020, 12:35:52 am
This is awesome! Now I found out what I'm gonna be doing for the rest of the night. :-)

Use the pause button now and then to give yourself a break :-)

By the way, my high score is just over 60,000, wave 11.
Title: Re: Vector Library and WideScreen Asteroids
Post by: Pete on February 06, 2020, 01:04:10 am
I can't blame you for being away for so long. It must have been murder trying to code even a few lines per day with such a bad case of asteroids, especially the wide screen kind. I hear those require lots of Preperation |---|.

Pete
Title: Re: Vector Library and WideScreen Asteroids
Post by: TerryRitchie on February 06, 2020, 02:14:34 am
I can't blame you for being away for so long. It must have been murder trying to code even a few lines per day with such a bad case of asteroids, especially the wide screen kind. I hear those require lots of Preperation |---|.

Pete

Son of a bitch I missed your humor! LOL
Title: Re: Vector Library and WideScreen Asteroids
Post by: keybone on February 06, 2020, 02:21:55 am
Use the pause button now and then to give yourself a break :-)

By the way, my high score is just over 60,000, wave 11.

so far im up to 16800, i forget which wave it was though, either 4 or 5.
Seriously think this might be better than the original
Title: Re: Vector Library and WideScreen Asteroids
Post by: TerryRitchie on February 06, 2020, 04:54:24 am
so far im up to 16800, i forget which wave it was though, either 4 or 5.
Seriously think this might be better than the original

That's what I was striving for. I love the coin-op Asteroids but always wish it was just a bit harder, with more effects, and more asteroids. The wide screen format provides the room for more asteroids. The program also notices when you "saucer hunt". The small saucers will start coming out and target you AND the remaining asteroids, forcing the next wave to appear.

The program continues to get progressively harder until wave 12. After that it will still count the waves encountered, but large asteroids will top out at 16. By that time though you have been thoroughly whipped just getting there. I never liked how in the original Asteroids you could somewhat "master" it. I doubt this version could be mastered, meaning that when you get a high score you've actually earned it. :-)

Oh, and there is a bug I just discovered tonight. I'm not yet sure how to trigger it but it seems if you hit an asteroid and one of your bullets hit it at the exact same time the kill will not get recorded and the ship will respawn in the exact location almost immediately. I don't yet see in the code where this could happen but it has happened to me twice now while playing. I've been purposely hurling myself at asteroids while firing in hopes of figuring out how I can trigger it at will to get an idea of where the bug lies.
Title: Re: Vector Library and WideScreen Asteroids
Post by: FellippeHeitor on February 06, 2020, 06:47:13 am
Quote
(...) it seems if you hit an asteroid and one of your bullets hit it at the exact same time the kill will not get recorded and the ship will respawn in the exact location almost immediately

Call it a feature and name those “the resilient ones”.

Always rich times when you’re around Terry! Welcome back.
Title: Re: Vector Library and WideScreen Asteroids
Post by: keybone on February 06, 2020, 06:51:25 am
That's what I was striving for. I love the coin-op Asteroids but always wish it was just a bit harder, with more effects, and more asteroids. The wide screen format provides the room for more asteroids. The program also notices when you "saucer hunt". The small saucers will start coming out and target you AND the remaining asteroids, forcing the next wave to appear.

The program continues to get progressively harder until wave 12. After that it will still count the waves encountered, but large asteroids will top out at 16. By that time though you have been thoroughly whipped just getting there. I never liked how in the original Asteroids you could somewhat "master" it. I doubt this version could be mastered, meaning that when you get a high score you've actually earned it. :-)

Oh, and there is a bug I just discovered tonight. I'm not yet sure how to trigger it but it seems if you hit an asteroid and one of your bullets hit it at the exact same time the kill will not get recorded and the ship will respawn in the exact location almost immediately. I don't yet see in the code where this could happen but it has happened to me twice now while playing. I've been purposely hurling myself at asteroids while firing in hopes of figuring out how I can trigger it at will to get an idea of where the bug lies.

I'm completely guilty of trying to saucer hunt. Didn't really work out as I hoped, now I know why... :-D
Title: Re: Vector Library and WideScreen Asteroids
Post by: TerryRitchie on February 06, 2020, 07:13:24 am
Call it a feature and name those “the resilient ones”.

Always rich times when you’re around Terry! Welcome back.

Thanks :-)

I think I found another bug but this time with $EXEICON

I added $CHECKING:OFF as the first line of my asteroids.bas source code. As soon as I tried to compile I got an error. It seems that $EXEICON adds a "do{" statement just before it (see main.txt) but never concludes with a "}while".

If I REM out the $EXEICON line the compile error disappears.

When I compile with $EXEICON and $CHECKING:OFF this is what I get:

C++ Compilation failed (check .\internal\temp\compilelog.txt)

When I open compilelog.txt it reads:

In file included from qbx.cpp:2171:
..\\temp\\main.txt: In function 'void QBMAIN(void*)':
..\\temp\\main.txt:244:6: error: expected 'while' before 'SUB_PROCESSKEYS'
 void SUB_PROCESSKEYS(){
      ^~~~~~~~~~~~~~~
compilation terminated due to -Wfatal-errors.

This is what I have in main.txt:

do{
sub__icon(NULL,NULL,0);
sub__icon(NULL,NULL,0);
sub__title(qbs_new_txt_len("Widescreen Asteroids",20));
qbs_cleanup(qbs_tmp_base,0);
qbg_screen(func__newimage( 1279 + 1 , 719 + 1 , 32 ,1),NULL,NULL,NULL,NULL,1);
sub_cls(NULL,NULL,0);
SUB_OBJINIT();
SUB_LOADASSETS();
SUB_SETFULLSCREEN();
do{
SUB_INTROSCREEN();
SUB_NEXTLEVEL();
do{
sub__limit( 60 );
sub_cls(NULL,NULL,0);
SUB_UPDATEGAME();
sub__display();
dl_continue_2:;
}while((!(*(int16*)(((char*)__UDT_GAME)+(32))))&&(!new_error));
dl_exit_2:;
dl_continue_1:;
}while(1);
dl_exit_1:;
sub_end();
return;
}

The last line should include a "while" and it doesn't. The very first "do{" seems to be created by $EXEICON.
Title: Re: Vector Library and WideScreen Asteroids
Post by: FellippeHeitor on February 06, 2020, 09:15:43 am
Thanks for the report. Looking into it now.
Title: Re: Vector Library and WideScreen Asteroids
Post by: FellippeHeitor on February 06, 2020, 09:58:20 am
Fixed. New dev build now contains a fix for it: https://www.qb64.org/portal/development-build/ (from git 03ba53e (https://github.com/QB64Team/qb64/commits/development))
Title: Re: Vector Library and WideScreen Asteroids
Post by: Pete on February 06, 2020, 11:49:16 am
...Always rich times when you’re around Terry! Welcome back.

Puns? I hates puns! I wish people would knock it the Fell off!

I can't recall if the Atari 2600 version used joysticks or paddle controls for the ship. I'm assuming yours is keyboard controlled, but I'm in the middle of so much open stuff right now, I can't get to trying it out just yet. I know some QB64 game programs can do all right with a mouse option. What I haven't tried are the STICK and STRIG commands in any programs. To that end, I visited one of the few threads we have here for game controllers...

https://www.qb64.org/forum/index.php?topic=452.msg3241#msg3241

I think it would be great to get some classic arcade games coded in QB64 with game controllers. I would just hope such an option would be responsive enough to produce the Nintended results. (Damn those puns again!!!) I see in my linked thread SirCrow was working on a similar space shooter game, with game controllers, but like his tag reads.... He doesn't always finish what he starts. On the good news side, he stated he got the controllers working properly, and in another link in that post, I see Fell also produced a game controller spaceship app, too.

Pete
Title: Re: Vector Library and WideScreen Asteroids
Post by: TerryRitchie on February 06, 2020, 03:26:03 pm
Fixed. New dev build now contains a fix for it: https://www.qb64.org/portal/development-build/ (from git 03ba53e (https://github.com/QB64Team/qb64/commits/development))

Excellent. That was fast. There's a special place in heaven for those who can navigate the source code.
Title: Re: Vector Library and WideScreen Asteroids
Post by: FellippeHeitor on February 06, 2020, 04:31:28 pm
Excellent. That was fast. There's a special place in heaven for those who can navigate the source code.

Amen!
😂🙏
Title: Re: Vector Library and WideScreen Asteroids
Post by: TempodiBasic on February 06, 2020, 04:38:08 pm
Hi Terry
fine to meet you again!

It is wonderful to see the remake of your Asteroid with this new your library!

A vector library WOW!
All these news together is a good news!

Info about Asteroids
wiki
https://en.wikipedia.org/wiki/Asteroids_(video_game) (https://en.wikipedia.org/wiki/Asteroids_(video_game))

youtube 1979
https://www.youtube.com/watch?v=WYSupJ5r2zo (https://www.youtube.com/watch?v=WYSupJ5r2zo)

AI learn to play Asteroids
https://www.youtube.com/watch?v=1o4naC4P8-M (https://www.youtube.com/watch?v=1o4naC4P8-M)

Great arcade vintage games!
Thanks Terry and Welcome back to QB64, where you bring me some time ago!



Title: Re: Vector Library and WideScreen Asteroids
Post by: TempodiBasic on February 06, 2020, 04:47:11 pm
about
Quote
I think I found another bug but this time with $EXEICON
for who has no time to download now the fixed version of QB64 1.4

Quote
Fixed. New dev build now contains a fix for it: https://www.qb64.org/portal/development-build/ (from git 03ba53e)
and he / she wants to try now the Asteroid Widescreen of Terry, well He/she can do this adding at start of namefile the path .\
as the following screenshot shows
  [ This attachment cannot be displayed inline in 'Print Page' view ]  
Title: Re: Vector Library and WideScreen Asteroids
Post by: TempodiBasic on February 06, 2020, 05:02:24 pm
PS
using the .EXE in the  zipped file I get some trouble running it... windows doesn't recognize it as a sure file to run... and while I'm playing I get a very huge effect of slowing the gameplay...
but compiling the .BAS with QB64 version 1.4 after using the ".\" in the path of icon file I get a very fast and wonderful WideScreen Asteroids!

Because I like break all asteroids very fast I am not able to go over 3 wave! :-) to fun to shoot fastly to all is moving!
Title: Re: Vector Library and WideScreen Asteroids
Post by: TerryRitchie on February 06, 2020, 05:05:08 pm
I too have noticed faster game play when compiling with QB 1.4 x86 and x64. I can also confirm that $CHECKING:OFF and $EXEICON work as expected in version 1.4.
Title: Re: Vector Library and WideScreen Asteroids
Post by: TerryRitchie on February 06, 2020, 11:18:11 pm
I just updated the ZIP file with what I believe is a bug fix for the bug mentioned earlier as well as the collision routines rewritten a bit to handle some inefficiencies I discovered while searching for the bug.

I also plan to rewrite the drop-down menu routine. I noticed that it slows down the screen in the background when lots of asteroids are flying around after a game (_PRINTSTRING is a CPU hog ). I'm going to use the OBJPrint vector printing routine instead that is implemented in the vector library.
Title: Re: Vector Library and WideScreen Asteroids
Post by: johnno56 on February 07, 2020, 01:03:07 am
Just now tried your game. Had a minor issue on line #2505 with the font name. As I run with Linux it complained about the case sensitivity of the font name. Other than that, it ran like a charm, got killed off more times than I liked, but ran like a charm none the less... Great game!!
Title: Re: Vector Library and WideScreen Asteroids
Post by: TerryRitchie on February 07, 2020, 02:02:55 am
Just now tried your game. Had a minor issue on line #2505 with the font name. As I run with Linux it complained about the case sensitivity of the font name. Other than that, it ran like a charm, got killed off more times than I liked, but ran like a charm none the less... Great game!!

Thank you for trying the game. I need to keep case sensitivity in mind from now on for our Linux users. Great to hear that it runs on Linux smoothly as well.
Title: Re: Vector Library and WideScreen Asteroids
Post by: Richard Frost on February 07, 2020, 03:43:51 am
That's a very impressive program.  I expect to learn a lot from the code.
Title: Re: Vector Library and WideScreen Asteroids
Post by: OldMoses on February 07, 2020, 08:52:01 am
I loved this game when I was a kid, but I couldn't afford all the quarters I had to pump into the damn machines. Thanks for coding this, it will be highly instructive and entertaining.
Title: Re: Vector Library and WideScreen Asteroids
Post by: Pete on February 07, 2020, 10:31:41 am
And don't worry about the quarters... Terry and I are combining our efforts to SHELL it out to a PayPal gateway. In the next release, you'll be coughing up Bitcoins like there's no tomorrow! Brewwooohahaaaaa!!!

Pete :D
Title: Re: Vector Library and WideScreen Asteroids
Post by: SMcNeill on February 07, 2020, 12:41:47 pm
I figured I'd do a quick copy/paste of the little demo which I wrote up for Cobalt to have a look at, as you might find interesting as well:

A little snippet of code for you to study, which you might want to incorporate into your game:

Code: QB64: [Select]
  1. Buttons = _LASTBUTTON(3) ' number of buttons on the joystick
  2. Axis = _LASTAXIS(3) 'number of axis on the joystick
  3.  
  4.     IF _DEVICEINPUT = 3 THEN 'joystick
  5.         FOR i = 1 TO Buttons
  6.             IF _BUTTON(i) THEN PRINT "Button "; i; "Down"
  7.         NEXT
  8.         FOR i = 1 TO Axis
  9.             IF ABS(_AXIS(i)) = 1 THEN PRINT "Axis "; i; "Pushed"; _AXIS(i)
  10.         NEXT
  11.     END IF
  12.  
  13.     _LIMIT 30

I've got one of the XBox style joysticks hooked up to my computer, with 12 buttons and 6 axis on it, and this little routine reads every input just fine.  Each button is an independent value of _BUTTON(1) to _BUTTON(12), and the 3 directional pads are represented by the axis.

Button values of -1 means the button was pressed down.
Axis values of -1 mean the axis was pushed fully left (or up), while values of 1 mean it was pushed fully right (or down), which is why I have this little demo checking for ABS() = 1.

_DEVICES is simple enough to add into an existing program, and you should be able to add it to your game with very little effort and offer joystick input for your users.  ;)

I'd also like to suggest adding a little config set-up option later, so an user can customize which of their keys relate to BUTTON A, BUTTON B, SELECT, START, and movement keys.
Title: Re: Vector Library and WideScreen Asteroids
Post by: TerryRitchie on February 07, 2020, 04:00:04 pm
Another update to the .ZIP file in the original post. A few efficiency changes and the drop-down menu rewrite.

Yes Steve, excellent! I've tried implementing joystick control in my games in the past without success. I'll give your approach a go. Thank you :-)

Let me know Pete when you're ready for my PayPal account information for the bitcoins <cheesy grin>

Thanks everyone for the kind words. It was fun creating this program and library. I'm happy that others can learn from the code. I should have the documentation for the library finished in a few weeks.
Title: Re: Vector Library and WideScreen Asteroids
Post by: Pete on February 07, 2020, 04:06:59 pm
:D
Title: Re: Vector Library and WideScreen Asteroids
Post by: TempodiBasic on February 07, 2020, 04:27:11 pm
someone said me that this is the next game implemented using the new library of Terry for vectorial graphic

video gameplaying
https://www.youtube.com/watch?v=agEQ7YIYk0A (https://www.youtube.com/watch?v=agEQ7YIYk0A)


images
https://www.pinterest.it/invaders/blaster/ (https://www.pinterest.it/invaders/blaster/)

https://www.arcade-museum.com/images/118/1181242060403.jpg (https://www.arcade-museum.com/images/118/1181242060403.jpg)

https://static.tvtropes.org/pmwiki/pub/images/blaster_screenshot.png (https://static.tvtropes.org/pmwiki/pub/images/blaster_screenshot.png)

Title: Re: Vector Library and WideScreen Asteroids
Post by: TerryRitchie on February 07, 2020, 04:51:05 pm
I grew up in the local coin-op arcades when I was a kid. I've never seen Blaster or even heard of it. It appears to be first person Defender. Even the sounds seem to be taken from Defender. Williams also made Defender so I suppose that makes sense. I'll bet that game was programmed on the 6809 processor, just like Defender and Robotron.
Title: Re: Vector Library and WideScreen Asteroids
Post by: Qwerkey on February 08, 2020, 06:11:57 am
Quote
Sorry I have been away for so long but...

Great to have you back, Terry.  Now the QB64 community is again complete.
Title: Re: Vector Library and WideScreen Asteroids
Post by: TerryRitchie on February 08, 2020, 03:22:31 pm
Great to have you back, Terry.  Now the QB64 community is again complete.

:-))
Title: Re: Vector Library and WideScreen Asteroids
Post by: TempodiBasic on February 08, 2020, 06:55:59 pm
Hi Terry

in my country I met both Blaster both Defender when I was a boy, but the first game  was Space Invaders!
And after they came DigDug, Burger, Pacman... :-) time goes over!

Do you remember this one game? https://www.youtube.com/watch?v=dkt-p1-pENA (https://www.youtube.com/watch?v=dkt-p1-pENA)
Nebulus! A pseudo 3D game.

PS I think that I take a look into your library waiting your official Help with examples.
Thanks to share
Title: Re: Vector Library and WideScreen Asteroids
Post by: TerryRitchie on February 11, 2020, 09:27:14 pm
I updated the .ZIP file again with yet another bug that I found and fixed. If you made it to level 12 (which I just now did, holy cow) it would promptly crash. I didn't have the asteroid array set high enough. Silly bug, easily fixed.

Oh, and TempodiBasic, I am working on the docs. It takes time to create all the various example code snippets to go along with each command but I'm getting there :-)

I've attached an example of what the docs will look like (PDF).
Title: Re: Vector Library and WideScreen Asteroids
Post by: TempodiBasic on February 12, 2020, 05:06:41 pm
Quote
I've attached an example of what the docs will look like (PDF).
I can say very good!
Title: Re: Vector Library and WideScreen Asteroids
Post by: OldMoses on March 03, 2020, 09:32:19 pm
Always loved Asteroids even though I was never that good at it. I spend more time waiting for the game to reset than I cared to, so forgive me if I added the following hack to SUB ProcessKeys...

Code: QB64: [Select]
  1.             ELSEIF _KEYDOWN(20992) THEN
  2.                 Game.ships = Game.ships + 1
  3.  

No more waitin'... ;)
Title: Re: Vector Library and WideScreen Asteroids
Post by: TerryRitchie on March 04, 2020, 03:06:34 am
Hack away :-)  Love to see people make my code better for their purposes.
Title: Re: Vector Library and WideScreen Asteroids
Post by: madscijr on November 23, 2021, 03:23:29 pm
Hack away :-)  Love to see people make my code better for their purposes.

@TerryRitchie
Your game is truly awesome! The visuals are gorgeous, the sounds are rich and immersive, and the movement & controls are fluid and responsive. It _feels_ like classic Asteroids, just better.

Do you document the vector format or otherwise have a utility program to draw or edit the game objects?

Also, there are a couple of mods that I always wanted to see in an Asteroids game. I'm not sure if any of these are within my skill (& free time!) range or would interest anyone else to take it up, but here goes.

I. ASTEROIDS COLLIDE WITH EACH OTHER
Maybe they smash each other apart or maybe they just bounce off each other.
But I always thought it kind of unrealistic that they just fly through each other.

II. GREATER VARIETY OF ASTEROID SIZES
Including really really big ones and really small ones.
How hard would it be to add asteroids of sizes
?
And the bigger ones wouldn't break up when the player shoots them.
Instead shooting at them digs a "tunnel" into them.
The player can fire into the asteroid and eventually fly through it.
In this way, the player can "cut" the asteroid in two.
These bigger asteroids wouldn't rotate very fast (maybe at harder levels) so the player doesn't have to worry about it moving rotationally as they fly through it.

III. 4-player Spacewar! variant where players battle (or cooperate) in the asteroids field. Atari sort of tried this with Space Duel but they left out some elements that made Asteroids so great (actual asteroids, the intense sounds like the deep rumbling of the ship's engines). Also a local multiplayer game for 4+ players makes it fun at a party!

I have a ton of other ideas stored up over the years for a game like this, but those are a couple of the less complicated ones.