Browse Source

asdf

master
Nicholas Hayashi 3 years ago
parent
commit
789cfbddd6
  1. 2
      build.sh
  2. 2
      conf.lua
  3. 12
      lib/random.lua
  4. 2
      main.lua
  5. 4
      src/game.lua

2
build.sh

@ -2,4 +2,4 @@
# add -mac, -windows, -linux, or -html if you only want one target
rm -r build/*
amulet export -r -d build/ -a .
amulet export -r -d build/ -a -html .
amulet export -r -d build/ -html .

2
conf.lua

@ -9,5 +9,5 @@ copyright_message = "Copyright © nick hayashi"
dev_region = "en"
supported_languages = "en"
luavm = "luajit"
--luavm = "lua51"

12
lib/random.lua

@ -39,13 +39,9 @@ local function randomseed2(seed)
X2 = v + 1
end
local R = math.random
local RS = math.randomseed
math.randomseed = function(seed)
RANDOM_CALLS_COUNT = 0
RS(seed)
end
local R = math.random
local function random(n, m)
RANDOM_CALLS_COUNT = RANDOM_CALLS_COUNT + 1
@ -63,6 +59,12 @@ local function random(n, m)
return r
end
math.randomseed = function(seed)
RANDOM_CALLS_COUNT = 0
R = am.rand(seed)
math.random = random
end
-- whenever we refer to math.random, actually use the function 'random' above
math.random = random

2
main.lua

@ -26,7 +26,7 @@ win = am.window{
height = SETTINGS.window_height,
title = "",
mode = SETTINGS.fullscreen and "fullscreen" or "windowed",
resizable = false,
resizable = true, -- as long as the aspect ratio is maintained via letterboxing
highdpi = true,
letterbox = true,
show_cursor = true,

4
src/game.lua

@ -66,8 +66,8 @@ local game_scene_menu_options = {
}
local function get_initial_game_state(seed)
--local STARTING_MONEY = 75
local STARTING_MONEY = 10000
local STARTING_MONEY = 75
--local STARTING_MONEY = 10000
local map = random_map(seed)
local world = make_hex_grid_scene(map, true)

Loading…
Cancel
Save