TRD Posted March 14, 2007 Report Share Posted March 14, 2007 Anyone know how to go about making a race positioning engine or something? You know, 1st place, 2nd place, etc? Using MMF 1.5. Thanks in advance. EDIT: Oh, I'm using over-head view btw or 8-directional movement....if that has something to do with it. Link to comment Share on other sites More sharing options...
Rael0505 Posted March 15, 2007 Report Share Posted March 15, 2007 I guess you could make a finish line object and give it an alterable value. Also, the players should have a finish variable. When the first player hits it, the value becomes 1, and the player's finish variable becomes 1. When a player hits it and the value is 1, you set it to 2, and you set that player's finish variable to 2. The finish line object variable is used to determine what place to give the player when it collides with it, and the player's finish variable tells what place it gets. Just got the idea in my head, but it should work. Does this make sense or am I explaining it poorly? Link to comment Share on other sites More sharing options...
MidimanNull Posted March 15, 2007 Report Share Posted March 15, 2007 Agreed, do what Rael says. have 2 alterable values for each player, 1 for laps, and 1 for distance. The First variable we will name "Laps", now, every time a player crosses over the loop line, you add 1 to the value. Now here is where the Second variable, " Distance " comes in, we take the position of the checkpoint/start line, and compare the distance between the player and it, the largest number will be the one in first, the least highest second, and so on. the laps is also relative to distance, so: If I were on lap 2, but were 45 pixels past the checkpoint, it would still be considered higher than lap 1, being 3000 pixels away from the checkpoint, even if it were extremely close to the checkpoint. Man I wish I had the enthusiasm to fangame again EDIT: 8 Direction overhead? use checkpoints, thats pretty much the only thing I can think of thatll fix it up lickety split 1 Link to comment Share on other sites More sharing options...
TRD Posted March 15, 2007 Author Report Share Posted March 15, 2007 Sweet, thanks guys. Rep to both of ya. EDIT: Hmm, it seems I had already given a rep point to Rael like...recently, bummer. Well thanks anyway Rael. Midi's now on a Distinguished Road. YAY! Link to comment Share on other sites More sharing options...
Recommended Posts