Compare commits
2 commits
Author | SHA1 | Date | |
---|---|---|---|
|
172404842b | ||
|
4525ad6ff6 |
6 changed files with 67 additions and 37 deletions
6
Makefile
6
Makefile
|
@ -1,6 +1,6 @@
|
||||||
LOVEFILE=autoeitmer.love
|
LOVEFILE=eitmer.love
|
||||||
WIN32_ZIPBALL=autoeitmer-win32.zip
|
WIN32_ZIPBALL=eitmer-win32.zip
|
||||||
NIX_TARBALL=autoeitmer-nix.tar.gz
|
NIX_TARBALL=eitmer-nix.tar.gz
|
||||||
|
|
||||||
.PHONY: all clean distclean run
|
.PHONY: all clean distclean run
|
||||||
|
|
||||||
|
|
24
README
24
README
|
@ -1,5 +1,25 @@
|
||||||
A dungeon crawler. That is, you are crawling around in a dungeon. Well, not you
|
A dungeon crawler. That is, you are crawling around in a dungeon. This means
|
||||||
in this version, but rather the computer.
|
you can't easily turn around in tight spaces and your vision to where you
|
||||||
|
came from is limited.
|
||||||
|
|
||||||
|
Find the Orb of Èitmer hidden within the dungeon, and beware the slimes for
|
||||||
|
it is up to chance whether you or they will prevail should you meet. It is
|
||||||
|
however better to face them head-on than to suffer an attack from behind.
|
||||||
|
|
||||||
|
If you find yourself stuck in a corner, try moving diagonally backwards.
|
||||||
|
|
||||||
|
i
|
||||||
|
jkl - movement up, left, down, right
|
||||||
|
|
||||||
|
u o
|
||||||
|
m . - movement upleft, downleft, downright, upright
|
||||||
|
|
||||||
|
a - autoexplore
|
||||||
|
|
||||||
|
space - do nothing for a turn
|
||||||
|
r - restart
|
||||||
|
q - quit
|
||||||
|
c - configure keybindings
|
||||||
|
|
||||||
The game code and assets are under Creative Commons Zero 1.0 Universal
|
The game code and assets are under Creative Commons Zero 1.0 Universal
|
||||||
license. If other code or data is distributed alongside them, see the
|
license. If other code or data is distributed alongside them, see the
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
function love.conf(t)
|
function love.conf(t)
|
||||||
t.window.title = "The Automatic Orb of Èitmer"
|
t.window.title = "The Orb of Èitmer"
|
||||||
t.window.width = 1280
|
t.window.width = 1280
|
||||||
t.window.height = 960
|
t.window.height = 960
|
||||||
t.window.resizable = true
|
t.window.resizable = true
|
||||||
|
|
|
@ -24,8 +24,10 @@ local player_animation_flip = false
|
||||||
local heart_sprite = nil
|
local heart_sprite = nil
|
||||||
|
|
||||||
local slimes = {}
|
local slimes = {}
|
||||||
|
local slime_animation_counter = 0
|
||||||
|
|
||||||
local move_repeat_counter = 0.1
|
local last_key_pressed = nil
|
||||||
|
local move_repeat_counter = nil
|
||||||
|
|
||||||
local gamemodes = {normal = 0, won = 1, lost = 2, config = 3}
|
local gamemodes = {normal = 0, won = 1, lost = 2, config = 3}
|
||||||
local game_mode = nil
|
local game_mode = nil
|
||||||
|
@ -34,13 +36,20 @@ local configuration_steps = {quit = -4, restart = -3, configure = -2, autoexplor
|
||||||
local configuration_step = nil
|
local configuration_step = nil
|
||||||
|
|
||||||
local direction_keys = {}
|
local direction_keys = {}
|
||||||
local control_keys = {quit = 'q', restart = '', configure = '', autoexplore = ''}
|
direction_keys['i'] = directions.up
|
||||||
|
direction_keys['u'] = directions.upleft
|
||||||
|
direction_keys['j'] = directions.left
|
||||||
|
direction_keys['m'] = directions.downleft
|
||||||
|
direction_keys['k'] = directions.down
|
||||||
|
direction_keys['.'] = directions.downright
|
||||||
|
direction_keys['l'] = directions.right
|
||||||
|
direction_keys['o'] = directions.upright
|
||||||
|
direction_keys['space'] = directions.inplace
|
||||||
|
local control_keys = {quit = 'q', restart = 'r', configure = 'c', autoexplore = 'a'}
|
||||||
|
|
||||||
local win_image = nil
|
local win_image = nil
|
||||||
local win_is_raster = true
|
local win_is_raster = true
|
||||||
|
|
||||||
local reset_counter = nil
|
|
||||||
|
|
||||||
-- ------------------------------------------------------------------
|
-- ------------------------------------------------------------------
|
||||||
-- Cavern generation
|
-- Cavern generation
|
||||||
-- ------------------------------------------------------------------
|
-- ------------------------------------------------------------------
|
||||||
|
@ -598,7 +607,6 @@ function newGame()
|
||||||
|
|
||||||
if collidedPlayerOrb() then
|
if collidedPlayerOrb() then
|
||||||
game_mode = gamemodes.won
|
game_mode = gamemodes.won
|
||||||
reset_counter = 5
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -676,7 +684,6 @@ function step(direction)
|
||||||
|
|
||||||
if collidedPlayerOrb() then
|
if collidedPlayerOrb() then
|
||||||
game_mode = gamemodes.won
|
game_mode = gamemodes.won
|
||||||
reset_counter = 5
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local body_x, body_y = getBodyLocation()
|
local body_x, body_y = getBodyLocation()
|
||||||
|
@ -743,7 +750,7 @@ function autoexplore()
|
||||||
|
|
||||||
for x, list in ipairs(visibility_map) do
|
for x, list in ipairs(visibility_map) do
|
||||||
for y, visible in ipairs(list) do
|
for y, visible in ipairs(list) do
|
||||||
if not visible and remembered_cavern[x][y] == nil or cavern[x][y] == tiletypes.orb then
|
if not visible and remembered_cavern[x][y] == nil then
|
||||||
distances[x][y] = {value = 0, direction = directions.inplace}
|
distances[x][y] = {value = 0, direction = directions.inplace}
|
||||||
neighbors(queue, x, y, 1)
|
neighbors(queue, x, y, 1)
|
||||||
end
|
end
|
||||||
|
@ -844,8 +851,13 @@ function drawCavern()
|
||||||
love.graphics.setColor(0, 0, 0)
|
love.graphics.setColor(0, 0, 0)
|
||||||
love.graphics.rectangle('fill', x, y, scale, scale)
|
love.graphics.rectangle('fill', x, y, scale, scale)
|
||||||
love.graphics.setColor(1, 1, 0)
|
love.graphics.setColor(1, 1, 0)
|
||||||
love.graphics.circle('fill', x + 0.5 * scale, y + 0.5 * scale, 0.8 * scale/2)
|
if slime_animation_counter < 0.7 then
|
||||||
|
love.graphics.circle('fill', x + 0.5 * scale, y + 0.6 * scale, 0.8 * scale/2)
|
||||||
|
love.graphics.rectangle('fill', x + 0.1 * scale , y + 0.6 * scale, 0.8 * scale, 0.8 * scale/2)
|
||||||
|
else
|
||||||
|
love.graphics.circle('fill', x + 0.5 * scale, y + 0.4 * scale, 0.8 * scale/2)
|
||||||
love.graphics.rectangle('fill', x + 0.1 * scale , y + 0.5 * scale, 0.8 * scale, 0.8 * scale/2)
|
love.graphics.rectangle('fill', x + 0.1 * scale , y + 0.5 * scale, 0.8 * scale, 0.8 * scale/2)
|
||||||
|
end
|
||||||
elseif tile == tiletypes.unknown then
|
elseif tile == tiletypes.unknown then
|
||||||
love.graphics.setColor(1, 0.5, 0.5)
|
love.graphics.setColor(1, 0.5, 0.5)
|
||||||
love.graphics.rectangle('fill', x, y, scale, scale)
|
love.graphics.rectangle('fill', x, y, scale, scale)
|
||||||
|
@ -1125,16 +1137,8 @@ end
|
||||||
function love.update(dt)
|
function love.update(dt)
|
||||||
if move_repeat_counter ~= nil and move_repeat_counter > 0 then
|
if move_repeat_counter ~= nil and move_repeat_counter > 0 then
|
||||||
move_repeat_counter = move_repeat_counter - dt
|
move_repeat_counter = move_repeat_counter - dt
|
||||||
if move_repeat_counter <= 0 then
|
if move_repeat_counter <= 0 and last_key_pressed ~= nil then
|
||||||
autoexplore()
|
love.keypressed(last_key_pressed)
|
||||||
move_repeat_counter = 0.1
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if reset_counter ~= nil then
|
|
||||||
reset_counter = reset_counter - dt
|
|
||||||
if reset_counter <= 0 then
|
|
||||||
newGame()
|
|
||||||
reset_counter = nil
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1145,9 +1149,13 @@ function love.update(dt)
|
||||||
flash_player_damaged_counter = flash_player_damaged_counter - dt
|
flash_player_damaged_counter = flash_player_damaged_counter - dt
|
||||||
if hp == 0 and flash_player_damaged_counter <= 0 and game_mode ~= gamemodes.won then
|
if hp == 0 and flash_player_damaged_counter <= 0 and game_mode ~= gamemodes.won then
|
||||||
game_mode = gamemodes.lost
|
game_mode = gamemodes.lost
|
||||||
reset_counter = 5
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
slime_animation_counter = slime_animation_counter + dt
|
||||||
|
while slime_animation_counter > 1.5 do
|
||||||
|
slime_animation_counter = slime_animation_counter - 1.5
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function love.keypressed(key)
|
function love.keypressed(key)
|
||||||
|
@ -1201,6 +1209,8 @@ end
|
||||||
|
|
||||||
function love.keyreleased(key)
|
function love.keyreleased(key)
|
||||||
if last_key_pressed == key then
|
if last_key_pressed == key then
|
||||||
|
last_key_pressed = nil
|
||||||
|
move_repeat_counter = nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,8 @@ die() {
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
mkdir -p tmp/autoeitmer-nix || die mkdir
|
mkdir -p tmp/eitmer-nix || die mkdir
|
||||||
cp autoeitmer.love README CC0 tmp/autoeitmer-nix
|
cp eitmer.love README CC0 tmp/eitmer-nix
|
||||||
|
|
||||||
cd tmp
|
cd tmp
|
||||||
tar czvf ../autoeitmer-nix.tar.gz autoeitmer-nix
|
tar czvf ../eitmer-nix.tar.gz eitmer-nix
|
||||||
|
|
|
@ -4,22 +4,22 @@ die() {
|
||||||
}
|
}
|
||||||
|
|
||||||
get() {
|
get() {
|
||||||
wget https://bitbucket.org/rude/love/downloads/love-$version-win32.zip || die wget
|
wget https://github.com/love2d/love/releases/download/$version/love-$version-win32.zip || die wget
|
||||||
unzip love-$version-win32.zip || die unzip
|
unzip love-$version-win32.zip || die unzip
|
||||||
test -e love-$version-win32/ || mv love-$version*-win32/ love-$version-win32 || die "Can't find win32 love directory"
|
test -e love-$version-win32/ || mv love-$version*-win32/ love-$version-win32 || die "Can't find win32 love directory"
|
||||||
}
|
}
|
||||||
|
|
||||||
version="11.2"
|
version="11.3"
|
||||||
|
|
||||||
mkdir -p tmp/autoeitmer-win32 || die mkdir
|
mkdir -p tmp/eitmer-win32 || die mkdir
|
||||||
|
|
||||||
cd tmp
|
cd tmp
|
||||||
test -e love-$version-win32/ || get
|
test -e love-$version-win32/ || get
|
||||||
cd love-$version-win32/
|
cd love-$version-win32/
|
||||||
cat love.exe ../../autoeitmer.love > ../autoeitmer-win32/autoeitmer.exe || die cat
|
cat love.exe ../../eitmer.love > ../eitmer-win32/eitmer.exe || die cat
|
||||||
cp *.dll license.txt ../autoeitmer-win32/ || die cp
|
cp *.dll license.txt ../eitmer-win32/ || die cp
|
||||||
cp ../../README ../autoeitmer-win32/readme.txt || die cp
|
cp ../../README ../eitmer-win32/readme.txt || die cp
|
||||||
cp ../../CC0 ../autoeitmer-win32/CC0.txt || die cp
|
cp ../../CC0 ../eitmer-win32/CC0.txt || die cp
|
||||||
|
|
||||||
cd ..
|
cd ..
|
||||||
zip -9 -r ../autoeitmer-win32.zip autoeitmer-win32
|
zip -9 -r ../eitmer-win32.zip eitmer-win32
|
||||||
|
|
Loading…
Reference in a new issue