Computer Science Canada Tron |
Author: | Insectoid [ Wed Mar 18, 2009 7:42 pm ] | ||
Post subject: | Tron | ||
So, I set about making Tron. After about 30 minutes of work, I had a semi-functional Tron game. The AI needs some work, and the collision detection is a bit odd (it does the explosion, but not the exit...odd). I'll post newer versions later. Perhaps I'm using the wrong command. Will 'exit' just exit the loop, or the program? Anywho, the code:
|
Author: | saltpro15 [ Wed Mar 18, 2009 8:10 pm ] |
Post subject: | RE:Tron |
exit should just exit the loop, this is cool, nice work |
Author: | Insectoid [ Wed Mar 18, 2009 8:15 pm ] |
Post subject: | RE:Tron |
Some more bugs to post! -there's a 'black hole' at the top centre (maxx div 2, maxy). I have yet to find out why, perhaps it's a perpetual collision. I suppose I'll post the controls too...and the objective. Objective: Survive. Don't hit any walls. Controls: You are the red line. Use the arrow keys to move around. You can only move at right angles. lol, we have nice karma scores, don't we Saltpro? |
Author: | saltpro15 [ Wed Mar 18, 2009 8:19 pm ] |
Post subject: | RE:Tron |
well I'm pretty sure mine is due to the spite of corriep giving me negative karma every time he logs in, poor jealous kid and this is the internet, I don't really care who wastes their life giving bad karma on CS forums |
Author: | copthesaint [ Wed Mar 18, 2009 8:24 pm ] | ||||
Post subject: | Re: Tron | ||||
Why not make an array of chars instead of having
instead have an array 4 keys per player
If you don't understand how you would do this just ask But I'm sure you could figure it out. Also even if you want this to be a 1 player game this would stll make your code shorter. |
Author: | Insectoid [ Wed Mar 18, 2009 8:28 pm ] |
Post subject: | RE:Tron |
I see, but it's a 1-player game. 3 AI players. It's for me to try out AI. I'm going to add in that they will move spontaneously as well as thoughtfully. I get what you're doing, though I'd still have to have the 'if' statements there, to tell the program what to do if that key is pressed. So even if I do make it 4 player, I don't see why I'd do that. |
Author: | BigBear [ Wed Mar 18, 2009 8:39 pm ] |
Post subject: | RE:Tron |
that exit statement exits the for loop but stays in the main loop. Try adding an exit when collision = true |
Author: | Insectoid [ Wed Mar 18, 2009 8:54 pm ] |
Post subject: | RE:Tron |
I changed that in my more recent version. It now exits when 3 players crash. Still haven't figured out the black hole... And I'm sure there was a command that completely terminates the program. |
Author: | BigBear [ Wed Mar 18, 2009 9:21 pm ] |
Post subject: | RE:Tron |
Well there is quit which crashes the prgram and which should not be used. |
Author: | The_Bean [ Wed Mar 18, 2009 9:31 pm ] |
Post subject: | Re: Tron |
'return' could be used, although its more meant for procedures, but can be used for the main program. |
Author: | BigBear [ Wed Mar 18, 2009 9:51 pm ] |
Post subject: | RE:Tron |
return will go back one step so it will act the same as exit. or terminate the procedure |
Author: | copthesaint [ Wed Mar 18, 2009 9:54 pm ] | ||
Post subject: | RE:Tron | ||
This is what I ment if it was going to be 1 player.
|
Author: | The_Bean [ Wed Mar 18, 2009 10:09 pm ] | ||
Post subject: | Re: Tron | ||
Or even:
|
Author: | copthesaint [ Thu Mar 19, 2009 8:59 am ] |
Post subject: | RE:Tron |
yea just things like this to reduce the amount of executed lines |
Author: | Insectoid [ Thu Mar 19, 2009 9:58 am ] | ||
Post subject: | RE:Tron | ||
at any rate, it is single-player, so I won't worry about that. I'll remember it though. Anywho, here's the newest version. Still buggy, but improved. EDIT: *Smacks head on desk* Wow, I feel stupid now. I thought you meant that for easily making 4 player controls. After actually reading that and learning what that bit of code does, I...well, I know what it does. Woops. And the code:
|
Author: | Tallguy [ Mon Mar 23, 2009 9:00 am ] |
Post subject: | RE:Tron |
this is gonna sound really dumb, but i never really played tron before, so wats the objective of this game? |
Author: | A.J [ Mon Mar 23, 2009 9:38 am ] |
Post subject: | RE:Tron |
I haven't played Tron before, but I believe that the objective is to not collide with anything and to outlast the other lines. (i.e. last line standing ) |
Author: | Tallguy [ Mon Mar 23, 2009 11:56 am ] |
Post subject: | RE:Tron |
umm, i guess so, |
Author: | SNIPERDUDE [ Tue Mar 24, 2009 12:23 pm ] |
Post subject: | Re: Tron |
Tron was an arcade game that was originally based off of a movie. The movie: http://en.wikipedia.org/wiki/Tron_(film) The Game: http://en.wikipedia.org/wiki/Tron_(arcade_game) A screenshot of the original arcade game: |
Author: | Gackt [ Wed Apr 15, 2009 9:21 am ] |
Post subject: | RE:Tron |
[mod removed] [user banned] |
Author: | Tallguy [ Wed Apr 15, 2009 9:59 am ] |
Post subject: | RE:Tron |
dude..NO |
Author: | copthesaint [ Wed Apr 15, 2009 1:16 pm ] | ||
Post subject: | Re: Tron | ||
Insectiod, Why don't you destroy all of the tail of a player when they crash like in the real game?
|
Author: | leafs23 [ Sat May 30, 2009 4:27 pm ] |
Post subject: | RE:Tron |
i like it |
Author: | ecookman [ Sat May 30, 2009 6:49 pm ] |
Post subject: | RE:Tron |
good job...ai could use a little work tho. bits! |
Author: | leafs23 [ Sun May 31, 2009 1:59 pm ] |
Post subject: | RE:Tron |
yeah could u put AI in to the game |
Author: | Turing_Gamer [ Fri Nov 06, 2009 3:33 pm ] |
Post subject: | Re: Tron |
Not bad, AI could use some work... The collision pics need work... It's a little slow... Other than that, I give it 7/10 |
Author: | Kharybdis [ Fri Nov 06, 2009 7:41 pm ] |
Post subject: | RE:Tron |
why did gackt get banned? |
Author: | Insectoid [ Fri Nov 06, 2009 9:20 pm ] |
Post subject: | RE:Tron |
Because, his post was nonconstructive and offensive to the original poster (me). Haven't looked at this in ages. Moved on to bigger and better things. Sorting algorithms at the moment. |