User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 14

Thread: Scoring with dynamic strings

  1. #1
    Clicker Fusion 2.5

    Join Date
    Aug 2014
    Location
    Hawaii
    Posts
    77
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Scoring with dynamic strings

    Hey CT gang,

    If you've ever played Galaga, you know that at the end of the Challenge level, you are given some string texts like this:

    "Number of Hits: 38"
    "Bonus Points = 3800"

    Then the Bonus Points counts down to zero (on a 1 second timer I think), and the points are incremented by 1 on the players score.
    So I can make a string object and place it next to a counter for line 1.
    Then do the same for line 2 do the same.

    But I'm stuck on two questions.

    First, is that the best way to do scoring? (String and a counter going visible like in line 1 and 2 above)
    Second, how do I replicate the count down hits / count up of scoring like in Galaga? Even better, how would I use an object / image as the total and do the Galaga count down / count up?

    Example:
    Lets say they killed three outta the five ufos. I'd like to see:

    "[UFO image][UFO image][UFO image] killed = 1500 pts"
    Then 1500 counts down to 0 in a second, and as it does, the players score goes up the same amount. Basically adding the ufo kill points to the main score.

    Ideas?

    Wiggy

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)
    schrodinger's Avatar
    Join Date
    Nov 2014
    Posts
    3,159
    Mentioned
    28 Post(s)
    Tagged
    1 Thread(s)
    For first question I've not any particular suggestion, do what you feel more comfortable with.

    second question,
    on level finished,
    you could start a loop "number-of-ufo-kills" time,
    on this loop, create a "ufo" object in the middle of the screen,
    and then set its X position to:
    frame width/2 - owidth("ufo")*2.0*(loopindex("loopname")-loopindex("loopname")/2.0)
    ^ this should more or less center the ufos, but I could think of a better formula

    For countdown,
    just subtract from counter the starting counter value /60.0 on an "always" basis ---> once per frame,
    so this would averagely do it in a second,
    and at the same time add the amount you subtract to the total score counter.

    I could make a small example if any problem

  3. #3
    Clicker Fusion 2.5

    Join Date
    Aug 2014
    Location
    Hawaii
    Posts
    77
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey schrodinger,

    I was not able to log on all day till now and just saw this , so I'll give it a shot now and get back to you. The formula you put up... lol, I was okay with what it was doing / what you were trying to show me until after the 2.0 part, haha, then I got lost. I'll try it though and see how it goes.

    Thanks!!

  4. #4
    Clicker Fusion 2.5

    Join Date
    Aug 2014
    Location
    Hawaii
    Posts
    77
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmm, still working on the math for the String and the objects.

    I'm tracking number of ufos killed with a counter. Then executing the "ufos_killed_score" loop that number of times:
    -Start loop ufos_killed_score value ("ufo_killed_counter") times

    Then I'm doing a
    -On loop "ufos_killed_score"
    Creating a UFO object, then setting the location (using your formula) for the x and y position.

    Then I'm setting a string "UFOs Killed" to the x and y position (using your formula) but subtracting twice the width of the UFO so it will show up to the left.

    Sounds good right? Well, it comes out a little funny. It looks like this:
    score.jpg

    Still playing with it to get it all aligned, haha, then its off to the count down / count up part.

  5. #5
    Clicker Fusion 2.5

    Join Date
    Aug 2014
    Location
    Hawaii
    Posts
    77
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Think I'm gonna need an example on the second part.
    The part that is confusing is when you said to do it as an "always" condition. The "scoring events" shouldn't happen until the level is complete (otherwise how will I know how many ufo's are destroyed until the level is complete). So I made a flag to track if the level is complete (turned on when the last bomb is destroyed). And I execute the scoring loop "ufo_scoring" at the end when the flag is set. But I do not see a way to execute an always condition on that loop, if I have to wait to do it at the end of the level.

    Ideas?

  6. #6
    Clicker

    Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    DaveC's Avatar
    Join Date
    Jun 2007
    Location
    Perth, Australia
    Posts
    2,132
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)
    "always" just means once per frame.

    So if you had

    Flag 0 is on - subtract 1 from counter

    or "Always" - subtract 1 from counter

    the results would be the same.

  7. #7
    Clicker Fusion 2.5

    Join Date
    Aug 2014
    Location
    Hawaii
    Posts
    77
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks DaveC,

    That is a good explanation, and now I understand it. The problem is that I still don't see the solution.

    If always is once per frame, then I wouldn't want always. I would want "always" and "level_complete"... wait, I might have something there, let me try, lol

  8. #8
    Clicker Fusion 2.5

    Join Date
    Aug 2014
    Location
    Hawaii
    Posts
    77
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah, that worked.

    I just made another condition
    -Always
    -"Level Complete = 1"
    -"Ufo point total <> 0"

    2 events
    Add 1 to Score Counter
    Subtract 1 to Score Counter

    Works nice, thanks!

  9. #9
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)
    schrodinger's Avatar
    Join Date
    Nov 2014
    Posts
    3,159
    Mentioned
    28 Post(s)
    Tagged
    1 Thread(s)
    Back to pc, is all ok then?

    On your last post, as DaveC pointed out:

    -Always
    -"Level Complete = 1"
    -"Ufo point total <> 0"


    is the same as:

    -"Level Complete = 1"
    -"Ufo point total <> 0"


    I wrote "always" just to refer to a condition that would always return true when met

    As for UFO destroy counter,
    I was thinking that if the number is small and pre-determined,
    you may probably have easier times by creating an animation, with 1/5, 2/5 etc ufoes
    (i.e. ufos coloured on the total grayed out)
    or still better a counter with type=animation (see properties-settings for counter object)
    and forcing animation frame/counter value to ufo-destroy-count

    The looping solution is probably better for large (> 10) and dynamic (different objects to show) situations,
    but maybe less handy for this task

  10. #10
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)
    schrodinger's Avatar
    Join Date
    Nov 2014
    Posts
    3,159
    Mentioned
    28 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by wiggy View Post

    Then I'm setting a string "UFOs Killed" to the x and y position (using your formula) but subtracting twice the width of the UFO so it will show up to the left.
    Yeah I didn't test the formula and it's probably to tweak
    From the image it seems that you are offseting Y position too,
    while you should leave it unchanged after creation happning in the middle of screen
    (we only offset X position to leave them in the same row)

Page 1 of 2 1 2 LastLast

Similar Threads

  1. GF2 not scoring
    By mojoz in forum The Games Factory 2 - Technical Support
    Replies: 1
    Last Post: 6th April 2011, 05:30 PM
  2. Scoring
    By toastface5 in forum Multimedia Fusion 2 - Technical Support
    Replies: 10
    Last Post: 11th November 2009, 08:50 PM
  3. Online scoring
    By Keli in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 26th October 2009, 09:02 PM
  4. Scoring problem
    By stillhawk in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 29th June 2007, 06:01 AM
  5. Scoring
    By jrk in forum Multimedia Fusion 2 - Technical Support
    Replies: 11
    Last Post: 30th July 2006, 10:33 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •