Browse Source

Use set-fields more

master
Macoy Madson 5 months ago
parent
commit
15fb4c130c
  1. 25
      src/Presentation.cake

25
src/Presentation.cake

@ -1126,12 +1126,14 @@
(when (at 0 (path current-slide > trigger))
(cond
((= 0 (strcmp (path current-slide > trigger) "enter-wizard"))
(set (field g-wizard-hero animation-start-ticks) (SDL_GetPerformanceCounter))
(set (field g-wizard-hero anim) (addr anim-wizard-jump-in))
(set-fields g-wizard-hero
animation-start-ticks (SDL_GetPerformanceCounter)
anim (addr anim-wizard-jump-in))
(set should-render-wizard true))
((= 0 (strcmp (path current-slide > trigger) "enter-boar"))
(set (field g-boar-enemy animation-start-ticks) (SDL_GetPerformanceCounter))
(set (field g-boar-enemy anim) (addr anim-boar-jump-in))
(set-fields g-boar-enemy
animation-start-ticks (SDL_GetPerformanceCounter)
anim (addr anim-boar-jump-in))
(set should-render-boar true))
((= 0 (strcmp (path current-slide > trigger) "show-ground"))
(set should-render-ground true))
@ -1181,8 +1183,9 @@
(when (and
(!= (field g-wizard-hero anim) (addr anim-wizard-attack))
(keybind-tapped (addr s-attack-keybind) (addr s-key-states)))
(set (field g-wizard-hero animation-start-ticks) (SDL_GetPerformanceCounter))
(set (field g-wizard-hero anim) (addr anim-wizard-attack))
(set-fields g-wizard-hero
animation-start-ticks (SDL_GetPerformanceCounter)
anim (addr anim-wizard-attack))
(set queued-effect effect-id-fireball))
(var power-cycle-index int
@ -1202,8 +1205,9 @@
(incr sequential-cycle-index)
(when (>= sequential-cycle-index (array-size s-power-keybinds))
(set sequential-cycle-index 0))
(set (field g-wizard-hero animation-start-ticks) (SDL_GetPerformanceCounter))
(set (field g-wizard-hero anim) (addr anim-wizard-attack))
(set-fields g-wizard-hero
animation-start-ticks (SDL_GetPerformanceCounter)
anim (addr anim-wizard-attack))
(set queued-power-id (path power-key > power-id))))
(when (and (= (field g-wizard-hero anim) (addr anim-wizard-attack))
@ -1327,8 +1331,9 @@
(field g-wizard-hero animation-start-ticks) c-animation-frame-rate
(field g-wizard-hero x) (field g-wizard-hero y)))
(set (field g-boar-enemy x) (type-cast (* virtual-window-width 0.70f) int))
(set (field g-boar-enemy y) (- virtual-window-height (/ ground-height 2) boar-ground-height))
(set-fields g-boar-enemy
x (type-cast (* virtual-window-width 0.70f) int)
y (- virtual-window-height (/ ground-height 2) boar-ground-height))
(when should-render-boar
(unless (field g-boar-enemy animation-start-ticks)

Loading…
Cancel
Save