Brightsign BrightScript 2 Reference Guide Manuel d'utilisateur Page 56

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 59
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 55
56
if tick_count=6 then
tick_count=0
if m.snake.MakeLonger(m.text_field) then return
else
if m.snake.MoveForward(m.text_field) then return
endif
endif
end while
End Function
Sub gbDraw()
REM
REM given a roTextField Object in "m.text_field", draw a box around its edge
REM
solid=191 ' use asc("*") if graphics not enabled
m.text_field.Cls()
for w=0 to m.text_field.GetWidth()-1
print #m.text_field,@w,chr(solid);
print #m.text_field,@m.text_field.GetWidth()*(m.text_field.GetHeight()-1)+w,chr(solid);
next
for h=1 to m.text_field.GetHeight()-2
print #m.text_field,@h*m.text_field.GetWidth(),chr(solid);
print #m.text_field,@h*m.text_field.GetWidth()+m.text_field.GetWidth()-1,chr(solid);
next
m.snake.Draw(m.text_field)
End Sub
Function gbGameOver() As Boolean
msg$= " G A M E O V E R "
msg0$=" "
width = m.text_field.GetWidth()
height = m.text_field.GetHeight()
while true
print #m.text_field,@width*(height/2-1)+(width-len(msg$))/2,msg$;
sleep(300)
print #m.text_field,@width*(height/2-1)+(width-len(msg$))/2,msg0$;
sleep(150)
REM GetMessage returns the message object, or an int 0 if no message available
If m.buttons.GetMessage() <> invalid Then Return False
endwhile
End Function
REM *******************************************************
REM *******************************************************
REM ****************** ***********************
REM ****************** SNAKE OBJECT ***********************
REM ****************** ***********************
REM *******************************************************
REM *******************************************************
REM
REM construct a new snake BrightScript object
REM
Function newSnake(x As Integer, y As Integer) As Object
' Create AA Roku Object; the container for a "BrightScript Object"
snake=CreateObject("roAssociativeArray")
snake.Draw=snkDraw
snake.TurnNorth=snkTurnNorth
snake.TurnSouth=snkTurnSouth
snake.TurnEast=snkTurnEast
Vue de la page 55
1 2 ... 51 52 53 54 55 56 57 58 59

Commentaires sur ces manuels

Pas de commentaire