|
Post by Trooper on Sept 6, 2004 22:00:37 GMT -5
Okay guess what, I am proud to announce the release of my first ever game for Windows! Hard to believe after all the fun I had with the Apple IIe and Amiga Basic. Anyway, yes yes, it IS a snake game! But this is no ordinary snake game, it's a two player battle. Grab a friend, download the game, and play it a bit. Or you can play it one player, but I find it very difficult to control two snakes at once and be unbiased as to which one will win. I set up a download page including a screen capture, and for those of you who are interested, the source is included in the .zip! games.andrewhoyer.com/tron/Enjoy! Andrew
|
|
|
Post by ilavos on Sept 6, 2004 22:59:04 GMT -5
Haa snake.I just love it.Maybe is it because it was THE first game i ever programmed( on my casio calculator if you want to know).Anyway,nice job,its fun.
|
|
|
Post by Trooper on Sept 8, 2004 10:24:21 GMT -5
Haa snake.I just love it.Maybe is it because it was THE first game i ever programmed( on my casio calculator if you want to know).Anyway,nice job,its fun. Thanks. =o) I really enjoyed programming on the scientific calculators, although I always had one problem... you can't erase what you've drawn. I could always draw black pixels, but never clear them without clearing the whole screen. Too bad... maybe your Casio was better. I had the TI-81. Trooper
|
|
|
Post by ilavos on Sept 8, 2004 11:33:09 GMT -5
The first one i did was character based .It was easier to do and ran faster too!I did try to make one with the graph function of the caculator.I didnt really have to erase the whole screen everytime.I just had an array ( list) with the coordinates of the first and last pixel of my snake.All i did was erase the last one and add a pixel right before the first one.I gave up this one because it dint run fast enough and thus wasnt fun. How did you make yours??
|
|
|
Post by Trooper on Sept 8, 2004 11:51:52 GMT -5
If I even made a snake game on the calculator, it was no more than an endlessly growing snake that ran out of room too soon, and no apples either.
My first snake game was written on the Apple IIc, where I wrote a lot of games and such. The Apple made it really easy, using fat pixels like blocks so you could do simple graphics.
I still have an Apple IIc which I pull out every now and then to play some of the old games. Emulators are cool, but there's nothing like running the original machine. =o)
As for the array business... you need to have an array that tracks each segment of the snake body, right? What I'm wondering is... do you need to create an array large enough to hold the maximum sized snake you could possibly have? Or is there a way to dynamically increase an array size in Basic4GL? Pointers maybe? I'll have to look more closely at the arrays and how they work.
Trooper
|
|
|
Post by ilavos on Sept 8, 2004 12:19:38 GMT -5
Well thats how i did it anyway.I created a large array ( my calculator had a maximum array size of 250) but didnt use all of it.I started by making my snake 6 characters long.What i did was i inserted this subroutine that made the program skip deleting the last character in the snake body everytime an apple was eaten.This gave the illusion the snake was growing.And everytime it did that,since the snake got bigger,my array got bigger( i.e the variable representing the virtual limit to my array was incremented.) You could do the same in basic4gl because i dont know if there is a way to dynamically increase an array. I havent really though about porting my game to basic4gl.I'll try to see what it gives
|
|
|
Post by AHBanen on Sept 8, 2004 18:03:06 GMT -5
Andrew, Ilavos, As Basic4GL does neither support dynamic arrays nor associative arrays (which can be used as 'sparse' arrays) I would try to use two strings (which can be extended dynamically): one containing the X positions [chr$(X_pos)] of each snake element and the other containing the Y positions [chr$(Y_pos)]. The limit would be a 255*255 array (as chr$(0) as string delimiter could give problems). Using mid$ it would be very easy to manipulate these strings to account for the movement of the snake...
André
|
|
|
Post by Ilavos on Sept 8, 2004 18:08:34 GMT -5
Dont misunderstand,I wasnt talking about basic4gl but about my casio calculator, which does not allow string manipulations.So i had to come up with these methods. The other thing we were talking about was dynamically increasing an array.I didnt know if this feature was implemented in basi4gl.You say it is.Can you explain?.
|
|
|
Post by Trooper on Sept 8, 2004 22:32:10 GMT -5
The other thing we were talking about was dynamically increasing an array.I didnt know if this feature was implemented in basi4gl.You say it is.Can you explain?. Actually that was... 1) Arrays cannot be dynamically changed 2) Strings can be dynamically changed up to 255 characters. The string idea is really cool, although the screen is usually wider than 10, so you'd need a delimiter, resulting in less than 255 segments to the snake. I assume there is some kind of string search functions, will have to look that up. Interesting idea for sure. Trooper
|
|