diff --git a/updatedshmup.p8 b/updatedshmup.p8 index 3f1390f..1e15050 100644 --- a/updatedshmup.p8 +++ b/updatedshmup.p8 @@ -129,6 +129,15 @@ function _init() pal() end +function once_next_frame(f) + new_events:push_back{ + move = function() + f() + return true + end, + } +end + -- health gradients for 1..5 hp -- exactly, then all "more". hpcols_lut = csv[[36 @@ -1174,7 +1183,7 @@ blast = { hitship = function(self, _) if self.damage > 0 and not self.awaitcancel then self.awaitcancel = true - events:push_back{move = function() + once_next_frame(function() new_events:push_back{ wait = 2, obj = self, @@ -1189,8 +1198,7 @@ blast = { } self.damage = 0 self.awaitcancel = false - return true - end} + end) end end }