1 # this file is part of NIT ( http://www.nitlanguage.org ).
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
7 # http://www.apache.org/licenses/LICENSE-2.0
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.
15 # Handles the drawing of all the game
22 # Draw `self` onto `display` with image from `assets`
23 fun draw
(display
: Display, assets
: Assets)
25 display
.blit_centered
(assets
.ball
, center
.x
, center
.y
)
31 # Draw `self` onto `display` with image from `assets`
32 fun draw
(display
: Display, assets
: Assets)
34 display
.blit_rotated
(assets
.vertical_wall
, center
.x
, center
.y
, angle
)
40 # Draw all the entities onto `display`
41 fun draw
(display
: Display, assets
: Assets)
43 display
.clear
(0.0, 0.0, 0.0)
44 ball
.draw
(display
, assets
)
45 for wall
in walls
do wall
.draw
(display
, assets
)