diff --git a/compile_flags.txt b/compile_flags.txt index 0d9ff53d..c7554e80 100644 --- a/compile_flags.txt +++ b/compile_flags.txt @@ -1,4 +1,13 @@ -Ilib/miniaudio +-Ilib/glad -Ilib/stb -Ilib/umka/src --Ilib/rawdraw \ No newline at end of file +-Ilib/rawdraw +-Ilib/chew +-Ilib/umpr +-Wall +-Wextra +-Wno-unused-parameter +-Wno-sign-compare +-Wno-old-style-declaration +-Wno-implicit-fallthroughof diff --git a/examples/platformer/game/player.um b/examples/platformer/game/player.um index cf5eab0d..2b65a1a0 100644 --- a/examples/platformer/game/player.um +++ b/examples/platformer/game/player.um @@ -60,12 +60,10 @@ fn move() { if input.isPressed(input.key_left) { mot.x = -1 - body.i.fliph(false) } if input.isPressed(input.key_right) { mot.x = 1 - body.i.fliph(true) } mot.x *= th.delta * moveSpeed @@ -143,7 +141,7 @@ fn handle*() { if !dying && body.t.p.distanceTo(env.end) < global.tileSize { signal.emit("finish", null) } - + if colls := body.getColl(env.coins, 1); len(colls) != 0 { env.coins = delete(env.coins, colls[0].index) env.score++ diff --git a/examples/space-shooter/effects.um b/examples/space-shooter/effects.um index 137052d2..8992a220 100644 --- a/examples/space-shooter/effects.um +++ b/examples/space-shooter/effects.um @@ -18,9 +18,7 @@ fn init*() { emitters = []particles.Emitter{} } -fn handle*() { - -} +fn handle*() { } fn damage*() { dmgEffect.enqueue( @@ -30,18 +28,19 @@ fn damage*() { } fn enemyDestroy*(pos: th.Vf2) { + const particlec = 2000 e := particles.Emitter{ pos, th.Vf2{0, 0}, th.Vf2{0.1, 0.1}, false, true, th.Vf2{0, 360}, - 400, 0, - 0.2, 0.2, - 1, 0.6, 2, + 200, 0.4, + 0.4, 0.2, + 0.4, 0.2, 2, 0, 0, 0, []uint32{0xFFA500ff, 0xe9330caa}, - make([]particles.Particle, 200)} - + make([]particles.Particle, particlec)} + for i:=0; i < len(e.particles); i++ { e.particles[i] = particles.Particle{ th.time + std.rand() % 200, diff --git a/examples/space-shooter/hud.um b/examples/space-shooter/hud.um index b41689de..682aa6ba 100644 --- a/examples/space-shooter/hud.um +++ b/examples/space-shooter/hud.um @@ -29,5 +29,5 @@ fn draw*() { s: th.Vf2{1, 1}}, th.white) } - mainFont.draw(repr(global.score), th.Vf2{1, 1}, th.white, 1.0) + mainFont.draw(repr(global.score), th.Vf2{1, 1}, th.white, 0.2) } diff --git a/examples/space-shooter/main.um b/examples/space-shooter/main.um index ecb9f2be..b8c56caa 100644 --- a/examples/space-shooter/main.um +++ b/examples/space-shooter/main.um @@ -5,7 +5,7 @@ import ( "rect.um" "window.um" "canvas.um" - + "game.um" "menu.um" "star.um" @@ -34,7 +34,7 @@ fn main() { for window.cycle() { canvas.drawRect(0x000022ff, global.cam) - + star.handle() star.draw() diff --git a/examples/space-shooter/player.um b/examples/space-shooter/player.um index 4fcc713f..21783bd2 100644 --- a/examples/space-shooter/player.um +++ b/examples/space-shooter/player.um @@ -103,3 +103,4 @@ fn draw*() { bullets[i].draw(global.cam) } } + diff --git a/examples/space-shooter/star.um b/examples/space-shooter/star.um index 088dc702..e72f13ca 100644 --- a/examples/space-shooter/star.um +++ b/examples/space-shooter/star.um @@ -10,7 +10,7 @@ import ( const ( starNum = 200 - speed = 0.04 + speed = 0.01 ) var ( @@ -24,8 +24,8 @@ fn init*() { stars[i].y = -std.rand()%round(window.wp.y) stars[i].x = std.rand()%round(window.wp.x) - stars[i].w = 1 - stars[i].h = 2 + stars[i].w = 0.1 + stars[i].h = 0.2 } } diff --git a/src/entity.c b/src/entity.c index eba8a7c8..50454894 100644 --- a/src/entity.c +++ b/src/entity.c @@ -18,7 +18,7 @@ void th_ent_draw(th_ent *o, th_rect *camera) { th_transform t = o->t; t.pos.x -= camx; t.pos.y -= camy; - + // this logic is incorrect /*if (q.br.x < 0 || q.br.y < 0) return; @@ -29,10 +29,6 @@ void th_ent_draw(th_ent *o, th_rect *camera) { if (!o->img) { th_quad q; th_transform_rect(&q, t, o->rect); - for (uu i=0; i < 4; i++) { - q.v[i].x *= thg->scaling; - q.v[i].y *= thg->scaling; - } th_canvas_triangle(o->color, q.v[0], q.v[1], q.v[2]); th_canvas_triangle(o->color, q.v[0], q.v[2], q.v[3]); return; diff --git a/src/nav.c b/src/nav.c index 4db47580..d44eb7bf 100644 --- a/src/nav.c +++ b/src/nav.c @@ -88,7 +88,7 @@ void th_navmesh_nav(th_vf2 *cameFrom, th_navmesh *m, th_vf2 p1, th_vf2 p2) { p1 = vf2_to_loc(m, p1); p2 = vf2_to_loc(m, p2); - + struct qnode *q = push(NULL, p1, NULL, 0); /*th_vf2 *cameFrom = calloc(sizeof(th_vf2), umkaGetDynArrayLen((void *)&m->d)); for (int i=0; i < umkaGetDynArrayLen((void *)&m->d); ++i) {