2021-02-18 05:11:25 +01:00
|
|
|
require 'engine'
|
|
|
|
require 'shared'
|
|
|
|
require 'arena'
|
2021-03-05 08:29:19 +01:00
|
|
|
require 'buy_screen'
|
2021-02-18 05:11:25 +01:00
|
|
|
require 'objects'
|
2021-02-20 02:54:54 +01:00
|
|
|
require 'player'
|
|
|
|
require 'enemies'
|
2021-02-18 05:11:25 +01:00
|
|
|
|
|
|
|
|
|
|
|
function init()
|
|
|
|
shared_init()
|
|
|
|
|
|
|
|
input:bind('move_left', {'a', 'left'})
|
|
|
|
input:bind('move_right', {'d', 'right'})
|
|
|
|
input:bind('move_up', {'w', 'up'})
|
|
|
|
input:bind('move_down', {'s', 'down'})
|
|
|
|
|
2021-02-27 05:28:00 +01:00
|
|
|
local s = {tags = {sfx}}
|
2021-02-22 03:54:50 +01:00
|
|
|
shoot1 = Sound('Shooting Projectile (Classic) 11.ogg', s)
|
|
|
|
archer1 = Sound('Releasing Bow String 1.ogg', s)
|
|
|
|
wizard1 = Sound('Wind Bolt 20.ogg', s)
|
|
|
|
swordsman1 = Sound('Heavy sword woosh 1.ogg', s)
|
|
|
|
swordsman2 = Sound('Heavy sword woosh 19.ogg', s)
|
|
|
|
scout1 = Sound('Throwing Knife (Thrown) 3.ogg', s)
|
|
|
|
scout2 = Sound('Throwing Knife (Thrown) 4.ogg', s)
|
|
|
|
arrow_hit_wall1 = Sound('Arrow Impact wood 3.ogg', s)
|
|
|
|
arrow_hit_wall2 = Sound('Arrow Impact wood 1.ogg', s)
|
|
|
|
hit1 = Sound('Player Takes Damage 17.ogg', s)
|
|
|
|
hit2 = Sound('Body Head (Headshot) 1.ogg', s)
|
|
|
|
hit3 = Sound('Kick 16.ogg', s)
|
|
|
|
proj_hit_wall1 = Sound('Player Takes Damage 2.ogg', s)
|
|
|
|
enemy_die1 = Sound('Bloody punches 7.ogg', s)
|
|
|
|
enemy_die2 = Sound('Bloody punches 10.ogg', s)
|
|
|
|
magic_area1 = Sound('Fire bolt 10.ogg', s)
|
|
|
|
magic_hit1 = Sound('Shadow Punch 1.ogg', s)
|
|
|
|
magic_die1 = Sound('Magical Impact 27.ogg', s)
|
|
|
|
knife_hit_wall1 = Sound('Shield Impacts Sword 1.ogg', s)
|
2021-02-23 04:47:57 +01:00
|
|
|
blade_hit1 = Sound('Sword impact (Flesh) 2.ogg', s)
|
2021-02-22 03:54:50 +01:00
|
|
|
player_hit1 = Sound('Body Fall 2.ogg', s)
|
|
|
|
player_hit2 = Sound('Body Fall 18.ogg', s)
|
|
|
|
player_hit_wall1 = Sound('Wood Heavy 5.ogg', s)
|
|
|
|
pop1 = Sound('Pop sounds 10.ogg', s)
|
|
|
|
heal1 = Sound('Buff 3.ogg', s)
|
|
|
|
spawn1 = Sound('Buff 13.ogg', s)
|
2021-02-24 06:47:22 +01:00
|
|
|
alert1 = Sound('Click.ogg', s)
|
2021-02-23 04:47:57 +01:00
|
|
|
elementor1 = Sound('Wind Bolt 18.ogg', s)
|
2021-02-24 06:47:22 +01:00
|
|
|
saboteur_hit1 = Sound('Explosion Flesh_01.ogg', s)
|
|
|
|
saboteur_hit2 = Sound('Explosion Flesh_02.ogg', s)
|
|
|
|
saboteur1 = Sound('Male Jump 1.ogg', s)
|
|
|
|
saboteur2 = Sound('Male Jump 2.ogg', s)
|
|
|
|
saboteur3 = Sound('Male Jump 3.ogg', s)
|
|
|
|
spark1 = Sound('Spark 1.ogg', s)
|
|
|
|
spark2 = Sound('Spark 2.ogg', s)
|
|
|
|
spark3 = Sound('Spark 3.ogg', s)
|
|
|
|
stormweaver1 = Sound('Buff 8.ogg', s)
|
2021-02-26 04:52:28 +01:00
|
|
|
cannoneer1 = Sound('Cannon shots 1.ogg', s)
|
|
|
|
cannoneer2 = Sound('Cannon shots 7.ogg', s)
|
|
|
|
cannon_hit_wall1 = Sound('Cannon impact sounds (Hitting ship) 4.ogg', s)
|
|
|
|
pet1 = Sound('Wolf barks 5.ogg', s)
|
|
|
|
turret1 = Sound('Sci Fi Machine Gun 7.ogg', s)
|
|
|
|
turret2 = Sound('Sniper Shot_09.ogg', s)
|
|
|
|
turret_hit_wall1 = Sound('Concrete 6.ogg', s)
|
|
|
|
turret_hit_wall2 = Sound('Concrete 7.ogg', s)
|
|
|
|
turret_deploy = Sound('321215__hybrid-v__sci-fi-weapons-deploy.ogg', s)
|
2021-02-27 05:28:00 +01:00
|
|
|
rogue_crit1 = Sound('Dagger Stab (Flesh) 4.ogg', s)
|
|
|
|
rogue_crit2 = Sound('Sword hits another sword 6.ogg', s)
|
2021-02-22 03:54:50 +01:00
|
|
|
|
2021-03-05 08:29:19 +01:00
|
|
|
warrior = Image('warrior')
|
|
|
|
ranger = Image('ranger')
|
|
|
|
healer = Image('healer')
|
|
|
|
mage = Image('mage')
|
|
|
|
rogue = Image('rogue')
|
|
|
|
nuker = Image('nuker')
|
|
|
|
conjurer = Image('conjurer')
|
|
|
|
enchanter = Image('enchanter')
|
|
|
|
psy = Image('psy')
|
|
|
|
|
|
|
|
class_colors = {
|
|
|
|
['warrior'] = yellow[0],
|
|
|
|
['ranger'] = green[0],
|
|
|
|
['healer'] = green[0],
|
|
|
|
['conjurer'] = yellow[0],
|
|
|
|
['mage'] = blue[0],
|
|
|
|
['nuker'] = blue[0],
|
|
|
|
['rogue'] = red[0],
|
|
|
|
['enchanter'] = red[0],
|
|
|
|
['psy'] = fg[0],
|
|
|
|
}
|
|
|
|
|
|
|
|
character_colors = {
|
|
|
|
['vagrant'] = fg[0],
|
|
|
|
['swordsman'] = yellow[0],
|
|
|
|
['wizard'] = blue[0],
|
|
|
|
['archer'] = green[0],
|
|
|
|
['scout'] = red[0],
|
|
|
|
['cleric'] = green[0],
|
|
|
|
['outlaw'] = red[0],
|
|
|
|
['blade'] = yellow[0],
|
|
|
|
['elementor'] = blue[0],
|
|
|
|
['saboteur'] = red[0],
|
|
|
|
['stormweaver'] = red[0],
|
|
|
|
['sage'] = blue[0],
|
|
|
|
['squire'] = yellow[0],
|
|
|
|
['cannoneer'] = green[0],
|
|
|
|
['dual_gunner'] = green[0],
|
|
|
|
['hunter'] = green[0],
|
|
|
|
['chronomancer'] = blue[0],
|
|
|
|
['spellblade'] = blue[0],
|
|
|
|
['psykeeper'] = fg[0],
|
|
|
|
['engineer'] = yellow[0],
|
|
|
|
}
|
|
|
|
|
|
|
|
character_classes = {
|
|
|
|
['vagrant'] = {'ranger', 'warrior', 'psy'},
|
|
|
|
['swordsman'] = {'warrior'},
|
|
|
|
['wizard'] = {'mage'},
|
|
|
|
['archer'] = {'ranger'},
|
|
|
|
['scout'] = {'rogue'},
|
|
|
|
['cleric'] = {'healer'},
|
|
|
|
['outlaw'] = {'warrior', 'rogue'},
|
|
|
|
['blade'] = {'warrior', 'nuker'},
|
|
|
|
['elementor'] = {'mage', 'nuker'},
|
|
|
|
['saboteur'] = {'rogue', 'conjurer', 'nuker'},
|
|
|
|
['stormweaver'] = {'enchanter'},
|
|
|
|
['sage'] = {'mage', 'nuker'},
|
|
|
|
['squire'] = {'warrior', 'healer', 'enchanter'},
|
|
|
|
['cannoneer'] = {'ranger', 'nuker'},
|
|
|
|
['dual_gunner'] = {'ranger', 'rogue'},
|
|
|
|
['hunter'] = {'ranger', 'conjurer'},
|
|
|
|
['chronomancer'] = {'mage', 'enchanter'},
|
|
|
|
['spellblade'] = {'mage', 'rogue'},
|
|
|
|
['psykeeper'] = {'healer', 'psy'},
|
|
|
|
['engineer'] = {'conjurer'},
|
|
|
|
}
|
|
|
|
|
2021-03-02 06:27:15 +01:00
|
|
|
units = {}
|
2021-03-05 08:29:19 +01:00
|
|
|
resource = 0
|
2021-03-02 06:27:15 +01:00
|
|
|
|
2021-02-18 05:11:25 +01:00
|
|
|
main = Main()
|
2021-03-05 08:29:19 +01:00
|
|
|
main:add(BuyScreen'buy_screen')
|
|
|
|
main:go_to('buy_screen', 0)
|
2021-02-18 05:11:25 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function update(dt)
|
|
|
|
main:update(dt)
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function draw()
|
|
|
|
shared_draw(function()
|
|
|
|
main:draw()
|
|
|
|
end)
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function love.run()
|
|
|
|
return engine_run({
|
|
|
|
game_name = 'SNAKRX',
|
|
|
|
window_width = 480*3,
|
|
|
|
window_height = 270*3,
|
|
|
|
})
|
|
|
|
end
|