Skip to content

Instantly share code, notes, and snippets.

@magik6k
Created February 8, 2017 23:17
Show Gist options
  • Save magik6k/293769ae33f9f269c8166831477020d1 to your computer and use it in GitHub Desktop.
Save magik6k/293769ae33f9f269c8166831477020d1 to your computer and use it in GitHub Desktop.
Example Hexagons! maps
color {
background: [
{ r: 0, g: 0, b: 0, a: 1, dynamicDarkness: 8.7, pulse: {r: 0.1764, g: 0.098, b: 0.0039, a: 0}, hue: { min: 0, max: 360, increment: 0.5, pingPong: false } }
{ r: 0, g: 0, b: 0, a: 1, dynamicDarkness: 9.5, pulse: {r: 0.0039, g: 0.098, b: 0.1764, a: 0}, hue: { min: 0, max: 360, increment: 0.5, pingPong: false } }
]
walls: { r: 1, g: 0.6078, b: 0.6078, a: 0.9019, main: true, pulse: {r: 0.1960, g: -0.2941, b: 0.4901, a: 0}, hue: { min: 0, max: 360, increment: 0.5, pingPong: false } }
pulseMax: 1.5
pulseIncrement: 0.025
switch: 1
}
local function acceleradiantWall(side, speed, acceleration, speedMin, speedMax)
timeline.addWall{
side = side,
thickness = patterns.THICKNESS,
speed = speed * patterns.getBaseSpeed(),
acceleration = acceleration,
speedMin = speedMin * patterns.getBaseSpeed(),
speedMax = speedMax * patterns.getBaseSpeed()
}
end
local function pACBarrage()
local difficulty = game.getProperty("difficulty.difficulty")
local sides = game.getProperty("sides.start")
local delay = patterns.getPerfectDelay(patterns.THICKNESS) * 3.7
local startSide = game.random(10)
for i = 0, sides - 2 do
acceleradiantWall(startSide + i, (9 + game.random(1)), -1.1 * difficulty, 1, 12)
end
timeline.wait(delay * 2.5)
end
local function pACBarrageMulti()
local difficulty = game.getProperty("difficulty.difficulty")
local sides = game.getProperty("sides.start")
local delay = patterns.getPerfectDelay(patterns.THICKNESS) * 3.7
local startSide = game.random(10)
for i = 0, sides - 2 do
acceleradiantWall(startSide + i, 10, -1.09 * difficulty, 0.31, 10)
acceleradiantWall(startSide + i, 0, 0.05 * difficulty, 0, 4)
acceleradiantWall(startSide + i, 0, 0.09 * difficulty, 0, 4)
acceleradiantWall(startSide + i, 0, 0.12 * difficulty, 0, 4)
end
timeline.wait(delay * 8)
end
local function pACBarrageMultiAltDir()
local difficulty = game.getProperty("difficulty.difficulty")
local sides = game.getProperty("sides.start")
local delay = patterns.getPerfectDelay(patterns.THICKNESS) * 3.7
local mdiff = 1 + math.abs(1 - difficulty)
local startSide = game.random(10)
local loopDir = game.randomDir()
for i = 0, sides + game.getHalfSides() do
local side = startSide + i * loopDir
acceleradiantWall(side, 10, -1.095 * difficulty, 0.40, 10)
timeline.wait((delay / 2.21) * (mdiff * 1.29))
acceleradiantWall(side + (game.getHalfSides() * loopDir), 0, 0.128 * difficulty, 0, 1.4)
end
timeline.wait(delay * 8)
end
local patternQueue = game.newPatternQueue{
{ weight = 7, pattern = pACBarrage },
{ weight = 2, pattern = pACBarrageMulti },
{ weight = 2, pattern = pACBarrageMultiAltDir }
}
local dirChangeTime = 6.666666
local hueIncMin = 0
local hueIncMax = 22.0
local hueIncStep = 0.0065
local hueInc = 0.5
function init()
patternQueue:shuffle()
game.loadProperties("properties.hocon")
end
function initColors()
game.loadProperties("colors.hocon")
end
function nextPattern()
patternQueue:addNext()
end
function update(delta)
dirChangeTime = dirChangeTime - delta
if dirChangeTime < 0 and not game.getProperty("rotation.rapidSpin") then
game.setProperty("rotation.speed", game.getProperty("rotation.speed") * -1)
dirChangeTime = 400 / 60
end
hueInc = hueInc + hueIncStep
game.setProperty("color.walls.hue.increment", hueInc)
game.setAll("color.background", "hue.increment", hueInc)
if hueInc > hueIncMax or hueInc < hueIncMin then
hueIncStep = hueIncStep * -1
end
end
rotation {
speed: 0.495
maxSpeed: 0.73
increment: 0.08
rapidSpinSpeed: 71
}
difficulty {
delayMultiplier: 1.1
delayMultiplierIncrement: -0.01
difficulty: 1
levelIncrement: 15
speed: 2.25
speedIncrement: 0.045
}
beatPulse {
max: 1.2
}
pulse {
min: 64
max: 84
speed: 1.05
speedReverse: 1.34
delayMax: 7
}
sides {
start: 6
min: 5
max: 7
}
view {
layers: 3
depth: 153.5
alphaMultiplier: 5.9
alphaFalloff: 0.06
skew: 0.83
minSkew: 0
maxSkew: 0.83
skewTime: 5.5
}
color {
background: [
{ r: 0.2392, g: 0, b: 0.2431, a: 1, pulse: {r: 0.2666, g: 0, b: 0.27058, a: 0} }
{ r: 0.7647, g: 0.2627, b: 0.5960, a: 1 }
]
walls: { r: 0.8745, g: 0.5803, b: 0.7176, a: 1, main: true, pulse: {r: 0.2352, g: 0.2352, b: 0.2352, a: 0} }
pulseMax: 1.8
pulseIncrement: 0.047
switch: 0.6
}
local patternQueue = game.newPatternQueue{
{ weight = 2, pattern = standardPattern.alternatingBarrage{ times = game.randomParam(2, 3), step = 2 } },
{ weight = 4, pattern = standardPattern.barrageSpiral{ times = 3, delayMult = 0.6, step = 1 } },
{ weight = 2, pattern = standardPattern.inverseBarrage{ times = 0 } },
{ weight = 1, pattern = standardPattern.tunnel{ times = game.randomParam(1, 3) } },
{ weight = 2, pattern = standardPattern.mirroredWallStrip{ times = 1, extra = 0 } },
{ weight = 1, pattern = standardPattern.vortex{ times = 0, step = game.randomParam(1, 2), 1 } },
{ weight = 1, pattern = standardPattern.fixedDelayBarrageSpiral{ times = game.randomParam(4, 7), delayMult = 0.4, step = 1 } },
{ weight = 3, pattern = standardPattern.randomBarrage{ times = game.randomParam(2, 5), delayMult = 2.25 } },
{ weight = 1, pattern = standardPattern.doubleMirrorSpiral{ times = game.randomParam(4, 6), extra = 0 } },
{ weight = 2, pattern = standardPattern.mirrorSpiral{ times = game.randomParam(2, 4), extra = 0 } }
}
local dirChangeTime = 2.666666
function init()
patternQueue:shuffle()
game.loadProperties("properties.hocon")
dirChangeTime = 46.1
end
local function lyric(text, wait, duration)
game.pushEvent(wait, "push_text", text, duration)
end
function initEvents()
lyric("Are you ready?", 2, 0.5)
for i = 1, 52 do
lyric("EH", 0.4 + (i == 1 and 0.5 or 0), 0.2)
game.pushEvent(0, "change_direction")
end
for i = 15, 0, -1 do
game.pushEvent(0.09, "rotation.speed", 0.65 * (i / 15))
end
lyric("Are you ready?", 0.15, 0.5)
game.pushEvent(0.09, "rotation.speed", 0.65 + 0.053)
for i = 1, 52 do
lyric("EH", 0.4 + (i == 1 and 0.5 or 0), 0.2)
game.pushEvent(0, "change_direction")
end
lyric("Adrenaline is pumping", 2, 1.5)
lyric("Adrenaline is pumping", 2, 1.5)
lyric("Generator", 2.5, 1)
lyric("Automatic lover", 2, 1.5)
lyric("Atomic", 4, 0.5)
lyric("Atomic", 1.5, 0.5)
lyric("Overdrive", 1.5, 1.0)
lyric("Blockbuster", 2.0, 1)
lyric("Brainpower", 3, 1)
lyric("Call me leader", 3, 1)
lyric("Cocaine", 2, 1)
lyric("Don't you try it", 3.5, 1.5)
lyric("Don't you try it", 2.5, 1.5)
lyric("Innovator", 3, 1)
lyric("Killing machine", 2, 1.5)
lyric("There's no fate", 3, 1.5)
lyric("Take control", 3, 1.5)
lyric("BRAINPOWER", 2.5, 1.5)
lyric("LET THE BASE KICK!", 2.0, 1.5)
end
function initColors()
game.loadProperties("colors.hocon")
end
function nextPattern()
patternQueue:addNext()
end
function update(delta)
dirChangeTime = dirChangeTime - delta
if dirChangeTime < 0 and not game.getProperty("rotation.rapidSpin") then
game.setProperty("rotation.speed", game.getProperty("rotation.speed") * -1)
dirChangeTime = 300 / 60
end
end
rotation {
speed: 0.65
maxSpeed: 1.5
increment: 0.053
rapidSpinSpeed: 81
}
difficulty {
delayMultiplier: 1.1
difficulty: 1
levelIncrement: 24
speed: 2.2
}
beatPulse {
delay: 0.25
}
pulse {
min: 64
max: 104
speed: 2.0
speedReverse: 1.5
delayMax: 1
}
sides {
start: 6
min: 5
max: 6
}
view {
layers: 12
depth: 5
alphaFalloff: 0.1
skew: 0
minSkew: 0
maxSkew: 1
skewTime: 4
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment