User Tag List

Results 1 to 4 of 4

Thread: Quick question about checking a value

  1. #1
    Clicker

    Fusion 2.5 Developer
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    J3sseM's Avatar
    Join Date
    Feb 2013
    Location
    Finland
    Posts
    868
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Quick question about checking a value

    Hey guys!

    I have event like this:
    Repeat while pressing Right - Set Alternable value A to 2
    Repeat while pressing Left - Set Alternable value to 4

    Very simple, there is much more code behind and stuff that complicates my code. I'm trying to simplify few things like this, so lets not get there.
    But instead I would like to know that does checking the value all the time (since now it checks it every time I hold a movement key) make things heavier?

    So basically does it matter, is there bugs to be expected etc?

    Thanks!

    - Jesse

  2. #2
    Clickteam Clickteam
    Danny's Avatar
    Join Date
    Aug 2007
    Location
    United Kingdom
    Posts
    3,016
    Mentioned
    21 Post(s)
    Tagged
    2 Thread(s)
    Quite vague in general this type of question but it's not heavy at all. You're just checking every tick for a repeat of Left/Right being held and setting a value. Should be fine...

    Try to rename your Alterable Values so it's easier to use as your code gets bigger/longer in events!
    Want to learn Clickteam Fusion 2.5?




  3. #3
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    UltimateWalrus's Avatar
    Join Date
    Jul 2006
    Posts
    824
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I once heard someone say that, in programming, premature optimization is root of all evil. That's a bit of exaggeration since it's not the root of all evil, but it is the root of a lot of it :]

    Focus on making your code nice and clean, don't worry about making it optimal unless you're positive a certain thing will slow things down in the future. It's much better to make clean, concise, understandable code, and if your game is slow later on, try deactivating chunks of events to see where the slowdown is happening.

  4. #4
    Clicker

    Fusion 2.5 Developer
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    J3sseM's Avatar
    Join Date
    Feb 2013
    Location
    Finland
    Posts
    868
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Hey guys!

    Good answers, thank you!
    Organizing is easily my biggest weakness. I always find my folder structure is a mess, and files here and there. Afraid same applies with my code.
    I'm glad my game mechanics are quite simple, I think I will manage it.

    But yeah, thanks!

    - Jesse

Similar Threads

  1. Quick question
    By trav101 in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 4th April 2011, 02:54 PM
  2. Quick question
    By imamariobro in forum The Games Factory 2 - Technical Support
    Replies: 3
    Last Post: 4th November 2009, 10:33 PM
  3. Quick question
    By LazyCoder in forum Multimedia Fusion 2 - Technical Support
    Replies: 15
    Last Post: 12th December 2008, 02:07 AM
  4. Quick question
    By lembi2001 in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 6th May 2008, 09:08 PM
  5. quick question
    By Taco in forum Extension Development
    Replies: 5
    Last Post: 26th September 2007, 04:51 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
  •