Anim init
This commit is contained in:
+10
-11
@@ -1,8 +1,8 @@
|
||||
package main
|
||||
|
||||
import hm "core:container/handle_map"
|
||||
import "core:fmt"
|
||||
import math "core:math"
|
||||
import hm "core:container/handle_map"
|
||||
import rl "vendor:raylib"
|
||||
|
||||
SQRT2_INV :: 0.7071067811865476
|
||||
@@ -120,11 +120,15 @@ entity_draw :: proc(state: ^GameState, e: ^Entity) {
|
||||
sp := rl.GetWorldToScreen({b.pos.x, 0, b.pos.y}, state.camera)
|
||||
scale := SCREEN_H / state.camera.fovy
|
||||
|
||||
#partial switch v in b.gfx[0] {
|
||||
case GfxCircle:
|
||||
rl.DrawCircleV(sp, v.radius * scale, v.color)
|
||||
case:
|
||||
for &g, _ in b.gfx {
|
||||
gfx_draw(sp, &g)
|
||||
}
|
||||
|
||||
// #partial switch v in b.gfx[0] {
|
||||
// case GfxCircle:
|
||||
// rl.DrawCircleV(sp, v.radius * scale, v.color)
|
||||
// case:
|
||||
// }
|
||||
}
|
||||
|
||||
ground_effect_draw :: proc(state: ^GameState, e: ^Entity) {
|
||||
@@ -149,12 +153,7 @@ draw_arc_sector :: proc(pos: rl.Vector2, dir: rl.Vector2, radius: f32, arc: f32,
|
||||
a2 := start + arc * f32(i + 1) / f32(SEGMENTS)
|
||||
p1 := pos + rl.Vector2{math.cos_f32(a1), math.sin_f32(a1)} * radius
|
||||
p2 := pos + rl.Vector2{math.cos_f32(a2), math.sin_f32(a2)} * radius
|
||||
rl.DrawTriangle3D(
|
||||
{pos.x, 0.03, pos.y},
|
||||
{p1.x, 0.03, p1.y},
|
||||
{p2.x, 0.03, p2.y},
|
||||
color,
|
||||
)
|
||||
rl.DrawTriangle3D({pos.x, 0.03, pos.y}, {p1.x, 0.03, p1.y}, {p2.x, 0.03, p2.y}, color)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user