Score calculations???

chosenonestudioschosenonestudios Member Posts: 1,714
edited November -1 in Working with GS (Mac)
hey guys, when the main actor runs into a wall it adds a point to your score, (well thats what its supposed to do) but it adds two points each time. I think its because its hitting the wall twice. I set it up so when you touched it, it would change the attribute so you couldn't hit it anymore, but I think it lags so it always gives you two points. How would fix this? Thanks in advance!

Comments

  • synthesissynthesis Member Posts: 1,693
    Are you adding score from both actors? Make sure you have only one actor reporting a score tally.

    Also...collision events are not the best way to trigger scoring...

    I use a score tracker actor for all score adding...and then use collision detection switches within the game actors to initiate a score addition by telling the score tracker to execute a score adjustment. Its somewhat complex in its structure...but it avoids multiple collision triggers and allows you to do unique/custom things with scoring events.
  • chosenonestudioschosenonestudios Member Posts: 1,714
    Yes, there are two actors adding to the score, I'll do your switch management operation, could you go a little bit more in depth into that though? Thanks in advance:)
  • synthesissynthesis Member Posts: 1,693
    I will try to explain briefly...since I'm pretty busy.
    Here is the base logic...from here you will have to work it out on your own.

    You need a score tracker actor. In that actor...do all the score keeping and use switches so that it can only execute one score at a time...so that you don't get simultaneous scoring events in the case of a simultaneous collision. in this actor you can control the score readout values and the special FX in the event of what type of scoring occurred. use game attributes to track all of these different settings and switches.

    Then from the game actors...report a scoring event to the game attributes...such as scoreType...scoreAmount...scoreLocationX and Y, etc. Then the last switch you throw is the game.executeScoreEvent = true...which will tell the tracker to start running. Once the tracker has completed its scoring event procedures...the last switch it throws is a game attribute...readyToScore...which allows the game actors to send a score event once again.

    This cycle repeats in the background at all time. It will allow you to have individual actor types throw different scores to the game and have different kinds of scoring types and pretty much anything you want to program into the score tracker and the game. its basically a ping-pong loop between the tracker and the game actors.

    Make sense? Its fairly advanced score tracking...but it works and its really cool to use. But if you aren't ready for this complexity...just bookmark the thread and come back to it later when you are.

    Good Luck...
    Gotta get back to my game :)

    BTW:
    if you have both the wall and the game actor adding a point to the score...this would explain the "double" ticking in the score. Just have one or the other make the score tick.
  • chosenonestudioschosenonestudios Member Posts: 1,714
    yeah thanks, this really helps :)
Sign In or Register to comment.