Convex Wars FB

User projects written in or related to FreeBASIC.
Posts: 1767
Joined: May 27, 2005 10:34
Location: Philippines

Convex Wars FB

Postby relsoft » Oct 14, 2012 7:25

Hello guys, I made a new little game.



-See in-game instructions

About the game:

Just a minigame I made over the week to showcase Easy GL2D for FreeBasic.
Original game was an even smaller minigame I made in C++ to showcase Easy GL2D for C/C++.
It is also notable that because I wanted this game (the source at least)
to be a sort of a teaching material, I used the "easiest" ways to make this game.
Which means that I used internal FB commands almost exclusively, major absence of
pointers and use dim/redim as opposed to new[] (except for the polygon class).
Doing so did not really hamper the game's speed in any way so I guess FB's dynamic
allocation with run-time checks for arrays are not that slow as anyone might think. ;*)
I also commented the source like crazy so that anyone reading it could understand
the gist of what the code does.
Don't expect much from this as my purposes in making this game are:
- Stresstest and showcase Easy GL2D
- Make a game that only use the GlowLine() sub
- To make an example of how to make games in FB easily using some
of the most commonly used coding techniques( FSM, Factories, SAT(Separating Axis Theorem), etc )
- Share some of the most common classes I use (Keyboard, Joystick, Mouse, Vector2D, Polygon2D, etc)
- Brush up on my FB knowledge. I keep forgeting "then" and type {} in my for-loops, typing "switch"
for select cases, etc. but it was fun.


An asteroids clone with a funky experimental control system.
Just shoot everything that moves.
This is a "vector" game so GFX are made of simple glowlines.
Gameplay is kinda boring to say the least.

Sourcecode is provided for learning purposes.
Use to your hearts content, but I would enjoy knowing the things you used it for.
Code should never be used to harm anyone.
I used FBedit to code this game

- See in-game credits.
Posts: 8179
Joined: May 28, 2005 3:28

Re: Convex Wars FB

Postby D.J.Peters » Oct 14, 2012 15:17

funy good job.

Lachie Dazdarian
Posts: 2338
Joined: May 31, 2005 9:59
Location: Croatia

Re: Convex Wars FB

Postby Lachie Dazdarian » Oct 14, 2012 20:27

I love you relsoft. We should be together.
Posts: 88
Joined: Apr 03, 2011 3:44
Location: Inside the bomb

Re: Convex Wars FB

Postby Destructosoft » Oct 14, 2012 21:24

Very nice! Sort of Tempestesque, except you're not moving on the grid, but rather in the tunnel.

What's next, Concave Wars: Revenge of the Spoons? :)
Posts: 1358
Joined: Jun 04, 2005 9:51

Re: Convex Wars FB

Postby dafhi » Oct 14, 2012 23:24

lol @destruct..

amazing work, Rel. I feel like I'm this close -> "
Posts: 1767
Joined: May 27, 2005 10:34
Location: Philippines

Re: Convex Wars FB

Postby relsoft » Oct 16, 2012 6:10

Thanks guys. I was trying to stresstest Easy GL2D and what better way to test it than to make a game out of it. :*)

The mouse + key/joy combo sucked though.

The good thing is, I have a nice set of reusable stuff for my Platforming article. ;*)
Posts: 15
Joined: Feb 04, 2013 14:21
Location: Australia

Re: Convex Wars FB

Postby PAEz » Feb 08, 2013 9:24

Thats so cool!
I'm a sucker for glow lines and pretty things going boom.

And the code is great. I'm so glad you decided to go the "easiest" way to make a game, I'm finding it a fantastic read and gives me hope that I may do something like this one day.
Only problem is, I can't compile it.
When I try to compile it in FbEdit, I get this....

Code: Select all

C:\Program Files\FreeBASIC\fbc -s gui "ConvexWars.bas" "ConvexWars.rc"
ConvexWars.o:fake:(.text+0x11): undefined reference to `ENGINE::ENGINE()'
ConvexWars.o:fake:(.text+0x20): undefined reference to `ENGINE::INITIALIZE()@4'
ConvexWars.o:fake:(.text+0x2c): undefined reference to `ENGINE::INITEVERYTHING()@4'
ConvexWars.o:fake:(.text+0x38): undefined reference to `ENGINE::LOADSOUNDS()@4'
ConvexWars.o:fake:(.text+0x44): undefined reference to `ENGINE::LOADIMAGES()@4'
ConvexWars.o:fake:(.text+0x5a): undefined reference to `ENGINE::UPDATE()@4'
ConvexWars.o:fake:(.text+0x75): undefined reference to `ENGINE::SHUTDOWN()@4'
ConvexWars.o:fake:(.text+0x81): undefined reference to `ENGINE::~ENGINE()'
ConvexWars.o:fake:(.text+0x1b5): undefined reference to `VECTOR2D::operator=(VECTOR2D const&)@8'
ConvexWars.o:fake:(.text+0x1c8): undefined reference to `VECTOR2D::operator=(VECTOR2D const&)@8'
ConvexWars.o:fake:(.text+0x1db): undefined reference to `VECTOR2D::operator=(VECTOR2D const&)@8'
ConvexWars.o:fake:(.text+0x274): undefined reference to `VECTOR2D::operator=(VECTOR2D const&)@8'
ConvexWars.o:fake:(.text+0x287): undefined reference to `VECTOR2D::operator=(VECTOR2D const&)@8'
ConvexWars.o:fake:(.text+0x29a): more undefined references to `VECTOR2D::operator=(VECTOR2D const&)@8' follow

Build error(s)

...any idea on what Im doing wrong?....I really want to be able to mess with this.

Also, while Im here (and since I cant find any other way of contacting you).....
Is it cool to rehost your stuff somewhere else? Im putting FB stuff on that I want to share with other pepole. Im finding it annoying as hell to find code snippets on this forum (why was the archive taken down), so Im going to put a bunch of stuff on as I find it and leave it there for ever.

And thank you so much for all your hard work. Really appreciate you releasing all the code you have and your articles are great, really like the FSM and delta articles.

Thanks for your time.
Posts: 1767
Joined: May 27, 2005 10:34
Location: Philippines

Re: Convex Wars FB

Postby relsoft » Feb 12, 2013 1:01

You need to add all the *bas source as modules to FBedit.

ie. Make a project, project->add existing->file then add convexwars.bas. After that add all the other .bas files as modules by project->add existing->module.

Then compile.

Sure, no problem with me about the files but all my files could also be found at my site ->junk or ->projects
Posts: 683
Joined: Feb 16, 2010 15:34
Location: Europe

Re: Convex Wars FB

Postby petan » Feb 14, 2013 14:05

Wonderful shots !
Teaching code included - perfect !
Working on FB 0.23 !

Thank you, relsoft !

Posts: 15
Joined: Feb 04, 2013 14:21
Location: Australia

Re: Convex Wars FB

Postby PAEz » Feb 14, 2013 19:22

Thanks Relminator, it works great now.
Having a lot of fun playing with it....nearly got the controls I want, so close ;)

Return to “Projects”

Who is online

Users browsing this forum: No registered users and 5 guests