7 This file contains various functions that draw backgrounds.
13 backgrounds
.star_bg
= get_image("img/star_bg.bmp")
16 --background variables
17 backgrounds
.offset
= 0
20 --background-drawing functions
22 function backgrounds
.stars_fixed()
24 local wide
= math
.ceil(s_width
/128)
25 local tall
= math
.ceil(s_height
/128)
29 display(backgrounds
.star_bg
, 128 * i
, 128 *j
,0,1,1)
36 function backgrounds
.stars_scrolling(speed
)
38 local wide
= math
.ceil(s_width
/128)
39 local tall
= math
.ceil(s_height
/128)
43 display(backgrounds
.star_bg
, 128 * i
, 128 *j
+ backgrounds
.offset
,0,1,1)
46 backgrounds
.offset
= backgrounds
.offset
+ (speed
or 4)
47 if backgrounds
.offset
>= 128 then backgrounds
.offset
= 0 end