tests: test_syntax now reports other errors before the pkgconfig error
[nit.git] / examples / mnit_ballz / src / assets.nit
1 # this file is part of NIT ( http://www.nitlanguage.org ).
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 # http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14
15
16 # All the assets needed by the appplication, regrouped in one class
17 module assets
18
19 import app::audio
20 import mnit::assets
21
22
23 # Contains all the assets
24 class Assets
25
26 # Sound for the wall destruction
27 var wall_destruction = new Sound("walld.wav")
28
29 # Sound when the ball bounce
30 var bounce = new Sound("bounce.ogg")
31
32 # Image of the ball
33 var ball: Image is noinit
34
35 # Image for the horizontal walls
36 var horizontal_wall: Image is noinit
37
38 # Image for the vertical walls
39 var vertical_wall: Image is noinit
40
41 # Loads all the assets
42 fun load do
43 ball = app.load_image("images/ball.png")
44 horizontal_wall = app.load_image("images/horizontal_wall.png")
45 vertical_wall = app.load_image("images/vertical_wall.png")
46 wall_destruction.load
47 bounce.load
48 end
49 end