Post by joeschmoe on Sept 23, 2011 16:35:34 GMT -5
This will probably be easier for you to think about if I just explain what I'm trying to do. I'll try to keep it short...
I've been working for some time, on and off, on an American football game. Ran into to some trouble, set it aside, and started working on other games such as the tank game I mentioned. When you suggested using OpenGL in parts of that game, I fooled around with it and realized that it might solve the problems in the football game.
To make a football game, I have to have a way to make the plays. So, a simple program to allow me to create and store plays. But, to show where players might move (a play diagram, if you're familiar with that), you have to be able to draw some lines.
Right now, I have some buttons and menus to set things up. I used OpenGL to place a big quad on the screen with the texture of a football field. On top of that, some sprites (just colored circles, nothing 3D) to represent players. Now, I need to be able to take one sprite's coords and draw a line from its center to some spot I want that player to move to so that I can see what everybody is doing on the play.
I could live without the lines but want to develop the play creation utility into one part of the game so that anybody could use it and know what's going on.
OK, so all I need is to understand how to draw a line, on top of one GL object, between specific points. I think I can work it out from there if I can just get it to work one time. The code you posted is pretty cool but I think it's blowing up my mind because I didn't expect that much to do that little. Maybe that's just how it is with OpenGL...
I've been reading the Redbook but that's going to take a while before I have a clue what I'm really doing...if I ever do.
Post by joeschmoe on Sept 23, 2011 19:57:55 GMT -5
Sure did. It's great for moving the ball on passes and kicks, but not so good for moving players...gets complicated when they collide and change directions or stop moving, at least, I don't know how to interrupt the loop. Can it be done?
Actually, checking 22 guys potential collisions with 21 other guys, multiple times per play, and vectoring mass, speed and direction, and determining if they "stick" to blocks or tackles is pretty hard for me...some very weird effects occur when I don't do it right.
Post by joeschmoe on Sept 26, 2011 11:33:57 GMT -5
That's going back a ways, for sure.
Breaking out of the loop...what would you use? A GOTO? Haven't used that statement in years. Wouldn't it mess up your stack? Dunno. Think I've seen that in some versions of BASIC...
Bunch of good stuff at that website. Thanks.
Regarding my problem with drawing lines...I still can't get it to work right. I was thinking of just using a sprite and changing its length and angle to get the effect I need. Not sure how that will look, tho...
Question: When you place a sprite, it stays there indefinitely without having to mess with it (more or less) but it seems like when I use GL I have to define an object (like the field) in every sub. Probably doing something wrong, but is that the way it works?
If you find yourself copying & pasting the same code into different subs then it's usually a sign that something is wrong with the structure of your program. The best place to see how to write your OpenGL programs is to look at some of the examples that Tom wrote in the Basic4GL Programs folder.
Post by joeschmoe on Sept 27, 2011 12:53:31 GMT -5
No doubt that the structure of my programs would make your skin crawl.
I'm at like step 2 in a 100-step process of learning how to do this...ignorant, undisciplined and probably not smart enough to comprehend half of what I see or that you guys tell me. But, I refuse to be intimidated by insurmountable odds.
Post by joeschmoe on Sept 27, 2011 14:24:35 GMT -5
OK. I uploaded it if you'd like to check it out.
This is the first game I ever attempted and got close to finished. Still has a few minor bugs and needs polishing and...a lot. Can't say it's fun to play but might be interesting. Sound is important to the "experience".
Very nice, it was better than any game I've managed to create in Basic4GL.
Some recommendations I'd make are the game could play a little faster & the graphics could be a bit larger. I found it difficult to see the players tank on the screen when I first played the game because it was so small.
I used UPX to decrease the size of the executable from 3.33 MB to 1.19 MB. You can download the smaller version here.