@@ -22,11 +22,11 @@ program main
2222 call set_target_fps(60 )
2323
2424 box_a = rectangle_type(10.0 , &
25- get_screen_height() / 2.0 - 50.0 , &
25+ SCREEN_HEIGHT / 2.0 - 50.0 , &
2626 200.0 , &
2727 100.0 )
28- box_b = rectangle_type(get_screen_width() / 2.0 - 30.0 , &
29- get_screen_height() / 2.0 - 30.0 , &
28+ box_b = rectangle_type(SCREEN_WIDTH / 2.0 - 30.0 , &
29+ SCREEN_HEIGHT / 2.0 - 30.0 , &
3030 60.0 , &
3131 60.0 )
3232 speed = 4
@@ -38,20 +38,20 @@ program main
3838 do while (.not. window_should_close())
3939 if (.not. pause ) box_a% x = box_a% x + speed
4040
41- if ((box_a% x + box_a% width >= get_screen_width() ) .or. (box_a% x <= 0 )) &
41+ if ((box_a% x + box_a% width >= SCREEN_WIDTH ) .or. (box_a% x <= 0 )) &
4242 speed = - 1 * speed
4343
4444 box_b% x = get_mouse_x() - box_b% width / 2.0
4545 box_b% y = get_mouse_y() - box_b% height / 2.0
4646
47- if (box_b% x + box_b% width >= get_screen_width() ) then
48- box_b% x = get_screen_width() - box_b% width
47+ if (box_b% x + box_b% width >= SCREEN_WIDTH ) then
48+ box_b% x = SCREEN_WIDTH - box_b% width
4949 else if (box_b% x <= 0 ) then
5050 box_b% x = 0.0
5151 end if
5252
53- if (box_b% y + box_b% height >= get_screen_height() ) then
54- box_b% y = get_screen_height() - box_b% height
53+ if (box_b% y + box_b% height >= SCREEN_HEIGHT ) then
54+ box_b% y = SCREEN_HEIGHT - box_b% height
5555 else if (box_b% y <= limit) then
5656 box_b% y = real (limit)
5757 end if
@@ -65,9 +65,9 @@ program main
6565 call clear_background(RAYWHITE)
6666
6767 if (collision) then
68- call draw_rectangle(0 , 0 , screen_width , limit, RED)
68+ call draw_rectangle(0 , 0 , SCREEN_WIDTH , limit, RED)
6969 else
70- call draw_rectangle(0 , 0 , screen_width , limit, BLACK)
70+ call draw_rectangle(0 , 0 , SCREEN_WIDTH , limit, BLACK)
7171 end if
7272
7373 call draw_rectangle_rec(box_a, GOLD)
@@ -76,11 +76,11 @@ program main
7676 if (collision) then
7777 call draw_rectangle_rec(box_c, LIME)
7878 call draw_text(' COLLISION!' // c_null_char, &
79- get_screen_width() / 2 - measure_text(' COLLISION!' // c_null_char, 20 ) / 2 , &
79+ SCREEN_WIDTH / 2 - measure_text(' COLLISION!' // c_null_char, 20 ) / 2 , &
8080 limit / 2 - 10 , 20 , BLACK)
8181
8282 write (str, ' ("Collision Area: ", i0)' ) int (box_c% width) * int (box_c% height)
83- call draw_text(trim (str) // c_null_char, get_screen_width() / 2 - 100 , &
83+ call draw_text(trim (str) // c_null_char, SCREEN_WIDTH / 2 - 100 , &
8484 limit + 10 , 20 , BLACK)
8585 end if
8686
0 commit comments