File: default.txt

package info (click to toggle)
highlight.js 10.7.3%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 8,332 kB
  • sloc: javascript: 41,059; makefile: 157; python: 29; sh: 20
file content (37 lines) | stat: -rw-r--r-- 667 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#IMAGE_FILES="*.png|*.jpg"
#SOUND_FILES="*.wav|*.ogg"
#MUSIC_FILES="*.wav|*.ogg"
#BINARY_FILES="*.bin|*.dat"

Import mojo

' The main class which expends Mojo's 'App' class:
Class GameApp Extends App
    Field player:Player

    Method OnCreate:Int()
        Local img:Image = LoadImage("player.png")
        Self.player = New Player()
        SetUpdateRate(60)

        Return 0
    End

    Method OnUpdate:Int()
        player.x += HALFPI

        If (player.x > 100) Then
            player.x = 0
        Endif

        Return 0
    End

    Method OnRender:Int()
        Cls(32, 64, 128)
        player.Draw()

        player = Null
        Return 0
    End
End