Computer Science Canada Anyone know to make the AI for a 100m olympic style game? |
Author: | born130 [ Mon May 12, 2003 10:16 pm ] |
Post subject: | Anyone know to make the AI for a 100m olympic style game? |
Hello Another question I have is how would i make the AI, for example I have an 8 lane race. How would I make the AI for this, such that the race ends if the AI finishes before the human player? My ideas are simply a terminate command if the first AI passes a certain point, i.e. the finish line. Also anyone know how I could put an onscreen timer? A slightly harder problem I need tackled is, how would i make the human player have a sort of acceleration bar. Meaning the faster i press the button"a" the faster he will go, but also when he starts he starts slow to fast! Thanks |
Author: | Tony [ Mon May 12, 2003 11:02 pm ] | ||
Post subject: | |||
AI is simple... just keep the computer player running at same uniform speed depending on the level. Harder level = faster computer. Nothing fansy there. As for the timer, just youse clock() function and use
as for acceleration. Measure how many times the user clicks in sertain time period (using clock). Then find the difference between two time intervals. Say user pressed 5 times during 1st second and 7 times during 2nd. So acceleration is 2 clicks per second^2 |
Author: | Office of the Registar [ Tue May 13, 2003 8:18 am ] |
Post subject: | |
what's the clock funciton do? |
Author: | Tony [ Tue May 13, 2003 8:40 am ] |
Post subject: | |
returns the time in milliseconds from when the program started... by recording clock() value at two times and finding the difference, you can calculate how much time has passed between when those times were taken. |