Computer Science Canada

Jaxc needs one more thing to help

Author:  Jacx [ Sun Jan 23, 2005 7:01 pm ]
Post subject:  Jaxc needs one more thing to help

Hey im having problems with the speed in my game and i cant figure out how to fix it, this is what i have so far


code:
var s :int := 40
var m :int := 0
proc lvl2
    var h, v : int
       var m := m + 10
 loop
 delay (s - m) %this controls the speed
        cls
end loop
end lvl2



I have that in with the rst of my game, I want to make it so when you go to the next level, or touch teh "box" it basically resets the level, but with the speed up by one (or the m value down by one so it subtracts from the speed value making teh delay less)

code:
if whatdotcolor (h, v + 20) = 0 then
            cls
            put "THIS IS THE END OF THIS TEST"
            delay (1000)
            lvl2
        end if
        if whatdotcolor (h, v - 20) = 0 then
            cls
            put "THIS IS THE END OF THIS TEST"
            delay (1000)
            lvl2
        end if
        if whatdotcolor (h + 20, v) = 0 then
            cls
            put "THIS IS THE END"
            delay (1000)
            lvl2
        end if
        if whatdotcolor (h - 20, v) = 0 then
            cls
            put "THIS IS THE END"
            delay (1000)
            lvl2
        end if



Can anyone help me out here??

Author:  Cervantes [ Sun Jan 23, 2005 7:12 pm ]
Post subject: 

Turing:

var standardDelay := 20
var levelDelayReduction := 3
var level := 1
loop
if victory then
  cls
  put "You win"
  level += 1
end if
delay (standardDelay - levelDelayReduction * level)
end loop


If you want to redraw the level (if it's a platformer, for example), you'll have to do that as well. Procedures containing all the drawing commands would work well enough for that.


: