Page 245 - Learn to Program - Basic-256
P. 245
Chapter 15: Arrays – Collections of Information. Page 229
74 if (rand<growpercent) then playerw = playerw + 1
75
76 # get player key and move if key pressed
77 k = key
78 if k = keyj then playerx = playerx - playerm
79 if k = keyk then playerx = playerx + playerm
80 if k = keyq then more = false
81
82 # keep player on screen
83 if playerx < 0 then playerx = 0
84 if playerx > graphwidth - playerw then playerx =
graphwidth - playerw
85
86 end while
87
88 print "score " + string(score)
89 print "you died."
90 end
Program 99: Big Program - Space Warp Game
© 2019 James M. Reneau (CC BY-NC-SA 3.0 US)

