User Tag List

Results 1 to 7 of 7

Thread: strange issue with counter :/

  1. #1
    Clicker Multimedia Fusion 2

    Join Date
    Jun 2007
    Posts
    163
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    strange issue with counter :/

    hi

    i set counter for my space craft so every hit by enemy bullets ,shown on the counter as "1" (counter count number of space craft hits). now..i am traying to use this counter to control the number of lives and here is the issue:
    if counter=100 then subtract 1 from number of lives
    and so on till there is no more lives and it jumped to another fame.
    now..one time , it works fine and i can see that after 100 ,one live is gone, but other times after counter=100, two lives gone and looks like the number of lives going crazy
    anyone have idea?

    also, how can i make screen to freeze for amount of time? and i mean:when game is over, i wants the same frame to wait few secs befor it jumps to the next frame or restart the aplication.

    thanks ahead.


  2. #2
    Forum Moderator Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleSWF Export Module
    DavidN's Avatar
    Join Date
    Jun 2006
    Location
    Boston, MA, USA
    Posts
    4,044
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: strange issue with counter :/

    For your problem with the counter, make sure you've added an "Only one action when event loops" condition to your "counter=100" event (you can find it under the Special object, the two monitors). Including this will only allow the event to run once - otherwise, if the counter hasn't changed from 100, another life will be subtracted. It's probably when you reach negative lives that the lives counter goes mad.

    To get the frame to wait for a few seconds, you need to trigger something that will cause a delay before performing the actions. My preferred way of doing it is like this:

    Code:
    When game is over
    -> Set value ("Counter") to 1
    
    If value("Counter") is greater than or equal to 1
    -> Add 1 to value of Counter
    
    If value of Counter is greater than 200
    -> Set counter to 0
    -> Do other actions here (in your case, jump to another frame)
    The number that you check for the counter being greater than determines how long the delay is - on drawing each frame of gameplay, the counter will be increased, so at the default frame rate of 50 a value of 200 would give a 4-second delay.

  3. #3
    Clicker Multimedia Fusion 2

    Join Date
    Jun 2007
    Posts
    163
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: strange issue with counter :/

    ok..now i know why the lives didn't react well
    and about the second issue, i will have to try it sounds complicated)

    on the way i will ask another question:
    is there option i can set , to let more objects runing on the screen at the same time?
    now looks like the limit here is 500 objects and i would love to have more

  4. #4
    Clickteam Clickteam
    Jeff's Avatar
    Join Date
    Jun 2006
    Location
    Battle Ground Washington
    Posts
    11,826
    Mentioned
    8 Post(s)
    Tagged
    2 Thread(s)

    Re: strange issue with counter :/

    You can change the number of objects under the frame properties.

  5. #5
    Clicker Multimedia Fusion 2

    Join Date
    Jun 2007
    Posts
    163
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: strange issue with counter :/

    hanks alot

    very apriciate the fast and the quality help.

  6. #6
    Clicker Multimedia Fusion 2

    Join Date
    Jun 2007
    Posts
    163
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: strange issue with counter :/

    m..i dunno why but there is still problem with my lives and the counter
    i used: "Only one action when event loops" for every counter=(number) and still when i run the game, its still crazy..sometimes its right and other time, 2 lives lost when only one should sub..
    when i did a new game (pong) just to check this issue, everything worked perfect.
    what can cause this?
    i tried other way: player_life=150 (every time player hited by enemy bullet, sub one from player_life. if player_life=(number) sub 1 live, but this doesn't work also i can't find what cause this madness :/

    h e l p again

  7. #7
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export Module

    Join Date
    Feb 2007
    Location
    Queensland, Australia
    Posts
    317
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: strange issue with counter :/

    If you upload an example in the file archive forum I'm sure we'll be able to help you more.

Similar Threads

  1. Strange Counter Problems
    By Mikegames in forum Android Export Module Version 2.0
    Replies: 1
    Last Post: 20th June 2013, 02:10 PM
  2. Counter updating issue or code issue?
    By KLiK-iT in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 14th March 2013, 01:48 PM
  3. Strange ini / string format issue
    By Popcorn in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 31st October 2012, 10:08 PM
  4. Strange Sub-App Issue
    By Uzalu in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 22nd December 2009, 01:53 AM
  5. Strange Counter Behavior
    By drnebula in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 5th October 2008, 05:23 PM

Posting Permissions

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