Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to code efficiently
#3
Instead of using if...then...else....
Code:
    'Cell Animation
    draw image santa.run,santa.move,santa.jump,santa.cell
    if santa.cell<11 then
        santa.cell = santa.cell + dt*20
    else
        santa.cell = 0
    endif

Could it be used min() function for the animation above ? I still can't figure out where to code santa.cell = 0 ... 
Code:
    'Cell Animation
    draw image santa.run,santa.move,santa.jump,santa.cell
    santa.cell = min(santa.cell+dt*20,11)

    endif
Reply


Messages In This Thread
How to code efficiently - by 1micha.elok - 11-14-2024, 11:02 PM
RE: How to code efficiently - by johnno56 - 11-15-2024, 06:27 AM
RE: How to code efficiently - by 1micha.elok - 11-16-2024, 05:04 AM
RE: How to code efficiently - by Marcus - 11-16-2024, 10:25 AM
RE: How to code efficiently - by 1micha.elok - 11-17-2024, 09:31 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)