Computer Science Canada

Ledge

Author:  splik [ Sat Mar 10, 2007 11:31 pm ]
Post subject:  Ledge

Ledge is a game in which you must push the block off the edge in a certain amount of time. The time decreases accordingly.
Pretty simple.

Problems are that it flashes too much, and the frame rate is really low (like 0.5fps).

Author:  chrisbrown [ Sun Mar 11, 2007 1:05 pm ]
Post subject:  Re: Ledge

Not bad, but as many people will tell you, learn procedures. Check your spelling of graphics (grapgics?) in the first line, which will fix your flicker problem. When you learn arrays and subscripts of strings you can write your ledge.proc in 1007 fewer lines:
Turing:

var intro : array 1 .. 3 of string := init ("PUSH THE BLOCK OFF THE SIDE USING THE SPACEBAR",
    "YOU DO NOT HAVE ALL DAY", "YOU MUST DO IT IN THE AMOUNT OF TIME SPECIFIED")

for i : 1 .. 3
    for j : 1 .. length (intro (i))
        put intro (i) (j) ..
        View.Update
        delay (50)
    end for
    put ""
    delay (1000)
end for

Good start though, keep it up.


: