-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.odin
66 lines (54 loc) · 1.68 KB
/
main.odin
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
package tetris
import as "assets"
import re"rendering"
import "core:fmt"
import rl "vendor:raylib"
main :: proc() {
rl.SetConfigFlags({.WINDOW_RESIZABLE})
rl.InitWindow(530, 620, "test")
rl.InitAudioDevice()
rl.SetTargetFPS(120)
re.init_camera()
as.init_texturs()
as.init_sounds()
as.int_shaders()
init_tetris()
for (!rl.WindowShouldClose())
{
center_zoom()
re.maintane_masks()
rl.BeginTextureMode(re.light_mask)
rl.BeginBlendMode(rl.BlendMode.ADDITIVE)
re.calculate_particles_light()
// re.draw_simple_light({50,50},50)
// re.draw_simple_light({150,150},50)
// re.draw_simple_light({300,300},50)
rl.EndBlendMode()
rl.EndTextureMode()
tetris_logic()
rl.BeginDrawing()
rl.ClearBackground(rl.RAYWHITE)
rl.BeginMode2D(re.camera)
// if rl.IsMouseButtonDown(.LEFT) {
// for i in 0..=1 {
// particle :re.Particle = re.gen_p_confetti(rl.GetScreenToWorld2D(rl.GetMousePosition(), re.camera))
// re.spawn_particle(particle)
// //rl.PlaySound(as.sounds[as.sound_names.s_paper_swipe])
// }
// }
// if rl.IsMouseButtonDown(.RIGHT) {
// delta:rl.Vector2 = rl.GetMouseDelta()
// delta = (delta * -1.0/re.camera.zoom)
// re.camera.target += delta
// }
tetris_draw()
rl.EndMode2D()
//re.do_particle_mask()
re.calculate_particles()
re.do_lighting()
//rl.DrawFPS(10, 10)
rl.EndDrawing()
}
rl.CloseAudioDevice()
rl.CloseWindow()
}