- [WIP] Batman AI
- [WIP] EL_ALIEN AI - Multi-camera - Random starting places
This commit is contained in:
22
main.lua
22
main.lua
@@ -6,6 +6,9 @@ mode=modes.editing
|
||||
seltile = 0
|
||||
|
||||
actors={}
|
||||
cameras={}
|
||||
camera_names={"Premiere","EL_ALIEN","BatMan"}
|
||||
current_camera=1
|
||||
|
||||
function remove_actor(actor)
|
||||
for index, value in pairs(actors) do
|
||||
@@ -28,6 +31,9 @@ function _init()
|
||||
table.insert(actors,premiere)
|
||||
elalien.init()
|
||||
table.insert(actors,elalien)
|
||||
batman.init()
|
||||
table.insert(actors,batman)
|
||||
|
||||
z = zombie.new()
|
||||
table.insert(actors,z)
|
||||
c=caco.new(13,24,16,true)
|
||||
@@ -37,6 +43,10 @@ function _init()
|
||||
table.insert(actors,starter.new(11,16,32,scenes.abad_corfes))
|
||||
score.create()
|
||||
|
||||
table.insert(cameras,premiere)
|
||||
table.insert(cameras,elalien)
|
||||
table.insert(cameras,batman)
|
||||
|
||||
_update=update_game
|
||||
end
|
||||
|
||||
@@ -147,15 +157,15 @@ function update_game()
|
||||
else
|
||||
draw_hab(abad.hab,0,0)
|
||||
--text(abad.hab,1,1,2)
|
||||
draw_hab(elalien.hab,0,48)
|
||||
text("EL_ALIEN",2,49,8)
|
||||
draw_hab(cameras[current_camera].hab,0,48)
|
||||
text(camera_names[current_camera],2,49,8)
|
||||
|
||||
score.draw()
|
||||
setsource(tiles)
|
||||
prnt("x"..abad.vides,114,13,2)
|
||||
rectfill(102+(abad.energia>>1),30,122,37,16)
|
||||
|
||||
mapa_update(abad.hab,elalien.hab)
|
||||
mapa_update(abad.hab,cameras[current_camera].hab)
|
||||
|
||||
for key,actor in pairs(actors) do
|
||||
actor:update()
|
||||
@@ -174,6 +184,12 @@ function update_game()
|
||||
if btnp(KEY_RETURN) then
|
||||
mode=modes.editing
|
||||
mapa_restore_backup()
|
||||
elseif btnp(KEY_1) then
|
||||
current_camera=1
|
||||
elseif btnp(KEY_2) then
|
||||
current_camera=2
|
||||
elseif btnp(KEY_3) then
|
||||
current_camera=3
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user