Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Need ideas for a capture the flag game.
Index -> Programming, Turing -> Turing Help
Goto page 1, 2  Next
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Khrist




PostPosted: Tue Mar 15, 2005 3:15 pm   Post subject: Need ideas for a capture the flag game.

Im new, as you can tell by the posts, but ive been reading fromthis site for almost a month now. I found it at school when i was looking for Turing tutorials, becasue my teacher is fairly clueless and doesnt like to let people learn if he doesnt want to teach. Anyways, in about a month ive learned a lot using the tutorials and souce codes from here. I can program in Turing well ahead of my class now even the people who used turing last year. Anyways my first project was a simple tag game, and thats all it was to begin with... simple. Then i added in whos it, and the person whos it can run faster, as well as a count down timer to display who is it for longest. while doing that I learned some basic collision detection, some user control stuff and lots more. For my next project i want to make a CTF game, i have an idea for some different areanas as well as a way the game should be played. Im not sure how to go about this. Ill say what im thinking and hopefully people can help me with some ideas.

- 2 player game
- 5 flag captures wins
- the flag will be in the middle and the team will have to bring it back to its base to gain a point.
- the player with the flag will run slower


So theres some thing i want to play with, I think i could make the flag and the people, but im not sure how to make collison for obstacles. For instance, if theres a home base with some walls around it, how can you set limits for the player. Anyways if I can get input from any of you smart people, then i will start working on this game tonight after work. thanks in advance
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Tue Mar 15, 2005 4:01 pm   Post subject: (No subject)

a tile system should work the best for a game like this. Just load the map into a 2D array and check what type the cell is before allowing a player to move onto it (or not if it's marked as a wall)
Token




PostPosted: Tue Mar 15, 2005 5:05 pm   Post subject: (No subject)

mmmmm yah i double posted by accident as SSR said, can a mod delete this post or somthin, because i cant seem to figure out how...
Token




PostPosted: Tue Mar 15, 2005 5:05 pm   Post subject: (No subject)

okay the way i'd do it would be to load in a picture of an arena with walls and bariers and stuff and have it symetrical from each players side, use whatdotcolor to keep the players from going through the walls, then make it so that the players can shoot at each other and when one gets hit, he has to wait for somthing like 5 secconds before restarting at his base, just a few hints for you, i'd make each player have its own variable called status or somthing so
if status= 0 then the player does not have the flag
if status = then the player does have the flag so that if status = 1 then their base could be monitoring for their return, this is a really good idea tho, i think i might try it later on... well good luck and if you have problems just add me to msn and i should be able to help you out..
Flikerator




PostPosted: Tue Mar 15, 2005 6:05 pm   Post subject: (No subject)

For each player make a record. Check F10 help or tutorials on them. If you need any help post.
ssr




PostPosted: Tue Mar 15, 2005 6:25 pm   Post subject: (No subject)

yep I 'd use whatdotcolor for detection
and then make an array to see if one has got teh flag and bring it to base,
good luck

btw I think u made a double post token Very Happy
McKenzie




PostPosted: Tue Mar 15, 2005 8:16 pm   Post subject: (No subject)

Do a search on Collision Detection. I know the topic has been beaten to death. My two cents, whatdotcolour will seem like the magical answer at first, but it will come back to bite you, don't use it. The tile based approach is by far the easiest way, but you might not like the visual effect (the characters will move a whole tile at a time. Fine if they are 10x10 pixel characters, junk if they are 50x50.) The other option is to do a basic dirty rectangle check. There are more advanced ways still, but checking for overlapping rectangles is usually good enough.
Andy




PostPosted: Tue Mar 15, 2005 8:23 pm   Post subject: (No subject)

wow.. whatdotcolor.. what a stupid idea... what kind of idiot would use a method as stupid as that pshh
Sponsor
Sponsor
Sponsor
sponsor
Khrist




PostPosted: Wed Mar 16, 2005 12:37 am   Post subject: (No subject)

token, i wanted to do the shooting aspect origanally because i was inspired by a game called infantry. Anyways, i looked into different programs and the programming for bullets and shooting is a little above my head right now, im just kinda doding stepping stones, by the end of the semester i want to make a game with guys shooting.

Another thing to the other people talking about whatdotcolour and the arrays and stuff, i havnt done anything with arrays or whatdotcolour yet. So, im going to go read some tutorials and stuff now and hopefully i will learn enough about them from doing this ctf game that i can use them in the future. thanks for the ideas and keep em coming.
Bacchus




PostPosted: Wed Mar 16, 2005 6:31 am   Post subject: (No subject)

arrays can be quite handy and they work well for player variables if u use them with records. ex)
code:
var player:array 1..2 of
    record
        x,y,vx,vy:real %habit for me to use real values they have their uses
        captures:int
    end record
that right there would hold the information about the player (1 or 2) in that. to acces player 1 info you would do player(1).captures or player(1).vx, and for player two just change the number: player(2).captures or player(2).vx For going slower when you have the flag, i would use velocities (vx/vy) so during your main loop you would do something like:
code:
player(1).x+=player(1).vx
player(1).y+=player(1).vy
player(2).x+=player(2).vx
player(2).y+=player(2).vy
and to make them go slower you would just decrease the vx/vy
ssr




PostPosted: Wed Mar 16, 2005 7:51 pm   Post subject: (No subject)

Andy wrote:
wow.. whatdotcolor.. what a stupid idea... what kind of idiot would use a method as stupid as that pshh

**cough
no insults...
zylum




PostPosted: Wed Mar 16, 2005 9:41 pm   Post subject: (No subject)

ssr wrote:
Andy wrote:
wow.. whatdotcolor.. what a stupid idea... what kind of idiot would use a method as stupid as that pshh

**cough
no insults...


he was being sarcastic.. look at his name

khrist >> i was making a CTF game a long time ago... got side tracked by something else but this may come in useful for you.



CTF.zip
 Description:

Download
 Filename:  CTF.zip
 Filesize:  2.62 KB
 Downloaded:  102 Time(s)

Khrist




PostPosted: Wed Mar 16, 2005 11:15 pm   Post subject: (No subject)

I think im going to use whatdotcolor, token showed me some examples and now i know how to use it. I think being able to use whatdotcolor will help me a hell of a lot later on so im gonna get myself aquainted with it on this project and see how it goes. Thanks for your input everyone.

By the way, im looking for areana ideas, so if any of you want to draw a 800x600 map(jpg) and attach it ill see if I can use them. By the way, make the walls black. thanks again. ill post the game when i geta first version of it done.
ssr




PostPosted: Sat Mar 19, 2005 1:16 pm   Post subject: (No subject)

I will do it,
just a little problem my starting price is abput 100 bucks
...
ok jk, but I dont think we can help u on that
if u search arounf the forum, there are plenty of map makers that u might wanna use
8)
jamonathin




PostPosted: Wed Mar 23, 2005 9:01 am   Post subject: (No subject)

what you can do, and i've used it in games i've made before, is to find an arena, and it doesn't matter what it looks like, (i.e can have 200 different colors on it). Now what you do with it, is you make a copy of the map, and open the copy in paint or something. Then draw in a certain color, that you would have your program recognize as the "area where you can walk", and so on and so forth. Then in your program, everytime you update the screen, draw the copied image, check if the player is walking on the right color (whatdotcolor ( x , y ) ), and then draw the original image, and your map will have restrictions on it, and it will look nice and descent.
As you get more farmiliar with this technique, you can use it for tunnels, bridges, and what not where if the player walks on a bridge color, such a red, you don't draw his picture, but he's still moving around, untill he gets out into the open color.

The only downside to this is that it takes the program longer to load at the very beginning, but on the other hand, you can just put "Loading", and make a REAL loading screen for your game, unlike people who make false annoying ones. Razz
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 2  [ 16 Posts ]
Goto page 1, 2  Next
Jump to:   


Style:  
Search: