Compare commits
3 Commits
a4590821be
...
a5ce0fd020
Author | SHA1 | Date | |
---|---|---|---|
a5ce0fd020 | |||
dae108c231 | |||
2e46d87a84 |
6
todo.md
6
todo.md
@ -1,8 +1,8 @@
|
|||||||
## 1. refine existing engine (knowing what I know now)
|
## 1. refine existing engine (knowing what I know now)
|
||||||
|
|
||||||
- [ ] rewrite event queue as a linked list
|
- [x] rewrite event queue as a linked list
|
||||||
- [ ] rewrite animator stacks as linked lists
|
- [x] rewrite animator stacks as linked lists
|
||||||
- [ ] rewrite ship/bullet collections as linked lists
|
- [x] rewrite ship/bullet collections as linked lists
|
||||||
- [ ] update/draw mode switching system (high-efficiency version)
|
- [ ] update/draw mode switching system (high-efficiency version)
|
||||||
- [ ] render ship shields (even for large ships)
|
- [ ] render ship shields (even for large ships)
|
||||||
- [ ] duplicate file -- about to split away from Tyrian features
|
- [ ] duplicate file -- about to split away from Tyrian features
|
||||||
|
@ -1789,21 +1789,10 @@ function boom(x,y,boominess,is_boss)
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
function spark(sprs, x, y, butts, thrust, odds, fg)
|
spark_particle={}
|
||||||
if (sprs==nil or flr(rnd(odds)) ~= 0) return
|
mknew(spark_particle)
|
||||||
thrust *= 2.5
|
|
||||||
local target = fg and intangibles_fg or intangibles_bg
|
function spark_particle:move()
|
||||||
target:push_back{
|
|
||||||
x = x + rnd(4) - 2,
|
|
||||||
y = y + rnd(4) - 2,
|
|
||||||
sprs = sprs,
|
|
||||||
sidx = 1,
|
|
||||||
dx = (butts[0] - butts[1]) * thrust + rnd(2) - 1,
|
|
||||||
dy = (butts[2] - butts[3]) * thrust + rnd(2) - 1,
|
|
||||||
draw = function(self)
|
|
||||||
pset(self.x, self.y, self.sprs[self.sidx])
|
|
||||||
end,
|
|
||||||
move = function(self)
|
|
||||||
if (rnd(4) < 1) self.sidx += 1
|
if (rnd(4) < 1) self.sidx += 1
|
||||||
if (self.sidx > #self.sprs) return true
|
if (self.sidx > #self.sprs) return true
|
||||||
self.x += self.dx
|
self.x += self.dx
|
||||||
@ -1811,7 +1800,22 @@ function spark(sprs, x, y, butts, thrust, odds, fg)
|
|||||||
self.dx -= mid(0.05,-0.05, self.dx)
|
self.dx -= mid(0.05,-0.05, self.dx)
|
||||||
self.dy -= mid(0.05,-0.05, self.dy)
|
self.dy -= mid(0.05,-0.05, self.dy)
|
||||||
end
|
end
|
||||||
}
|
function spark_particle:draw()
|
||||||
|
pset(self.x,self.y,self.sprs[self.sidx])
|
||||||
|
end
|
||||||
|
|
||||||
|
function spark(sprs, x, y, butts, thrust, odds, fg)
|
||||||
|
if (sprs==nil or flr(rnd(odds)) ~= 0) return
|
||||||
|
thrust *= 2.5
|
||||||
|
local target = fg and intangibles_fg or intangibles_bg
|
||||||
|
target:push_back(spark_particle.new{
|
||||||
|
x = x + rnd(4) - 2,
|
||||||
|
y = y + rnd(4) - 2,
|
||||||
|
sprs = sprs,
|
||||||
|
sidx = 1,
|
||||||
|
dx = (butts[0] - butts[1]) * thrust + rnd(2) - 1,
|
||||||
|
dy = (butts[2] - butts[3]) * thrust + rnd(2) - 1,
|
||||||
|
})
|
||||||
end
|
end
|
||||||
-->8
|
-->8
|
||||||
-- powerups
|
-- powerups
|
||||||
|
Loading…
Reference in New Issue
Block a user