Jump to content
A 2021 backup has been restored. Forums are closed and work in progress. Join our Discord server for more updates! ×
SoaH City Message Board

1st Place, Second Place and so on how-to.


TRD

Recommended Posts

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

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

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

  • Like 1
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...