Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Cargas de Produndidad / Depth Charge
#3
Very nice little fun thing. Good job.

By the way, my sneaky fast t() function is:

Code:
FUNCTION t() as uLong
asm
    DI
    LD DE,(23674)
    LD D,0
    LD HL,(23672)
    EI
end asm
end function

Which saves a lot of maths and division. If you want to divide by 50 to get whole seconds, you can do it outside the function - but generally, I found t() returning clock ticks and working with them as 50 times larger meant I have more precision on where I launch events. (Instead of at 1s, 2s, 3s, I go 50 frames, 100 frames, 150 frames - and then if I want to I can tweak that to 40,80,120 much more easily).

I notice you are actually using it in the line:
a = t1 / 30 * PI

So to get t you do a lot of stack work, then divide by 50 - and then divide by 30. I think I'd do it as frames and divide by 150 in one go when setting a, which is probably shorter than running the full division twice.

Anyway. Just my thougts. The game is quite fun Big Grin Never enough depth charges.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)