3 次代码提交

共有 17 个文件被更改,包括 71 次插入37 次删除
  1. +0
    -2
      .build/builds/readme.txt
  2. +19
    -5
      .build/make-exe.sh
  3. +2
    -1
      .build/make-love.sh
  4. 二进制
      .build/win/OpenAL32.dll
  5. 二进制
      .build/win/SDL2.dll
  6. 二进制
      .build/win/love.dll
  7. 二进制
      .build/win/lua51.dll
  8. 二进制
      .build/win/mpg123.dll
  9. 二进制
      .build/win/msvcp120.dll
  10. 二进制
      .build/win/msvcr120.dll
  11. +14
    -1
      build.sh
  12. +1
    -1
      data/starshipTypes.lua
  13. +19
    -5
      src/calc.lua
  14. +4
    -4
      src/class/Button.lua
  15. +4
    -10
      src/class/Menubutton.lua
  16. +2
    -2
      src/class/Planet.lua
  17. +6
    -6
      src/class/Textbox.lua

+ 0
- 2
.build/builds/readme.txt 查看文件

@@ -1,2 +0,0 @@
your builds will be moved into this folder :)
dont delete me, im here so github doesn't delete this directory... i found out the hard way qwq

+ 19
- 5
.build/make-exe.sh 查看文件

@@ -1,13 +1,27 @@
#!/bin/bash #!/bin/bash
echo -e "\e[1;33m Building .exe! \e[0m"
doZip=true
path="./.build" path="./.build"


# Windows Folder # Windows Folder
winPATH=$path"/builds/"$1"-win" winDir=$1-win
mkdir $winPATH winPATH=$path"/builds/$winDir"
mkdir "$winPATH"


# Creating .exe # Creating .exe
cat $path"/love/love.exe" $path"/builds/"$1.love > $1.exe cat $path"/love/love.exe" $path"/builds/$1.love" > "$1.exe"
mv $1.exe $winPATH mv "$1.exe" "$winPATH"


# Moving dll's # Moving dll's
cp $path"/win/"* $winPATH cp $path"/love/"*".dll" "$winPATH"

# Zip it if $doZip == "true"
if [[ $doZip == "true" ]]; then
currentPath=$( pwd )
cd "$path/builds"
name=$1"-win.zip"
zip "$name" -r "$winDir"
cd "$currentPath"
rm -rf "$winPATH"
fi

+ 2
- 1
.build/make-love.sh 查看文件

@@ -1,3 +1,4 @@
#!/bin/bash #!/bin/bash
echo -e "\e[1;33m Building .love \e[0m"
zip -9 -r $1.love . -x ./.build/**\* ./.git/**\* zip -9 -r $1.love . -x ./.build/**\* ./.git/**\*
mv $1.love ./.build/builds mv $1.love ./.build/builds

二进制
.build/win/OpenAL32.dll 查看文件


二进制
.build/win/SDL2.dll 查看文件


二进制
.build/win/love.dll 查看文件


二进制
.build/win/lua51.dll 查看文件


二进制
.build/win/mpg123.dll 查看文件


二进制
.build/win/msvcp120.dll 查看文件


二进制
.build/win/msvcr120.dll 查看文件


+ 14
- 1
build.sh 查看文件

@@ -1,11 +1,24 @@
#!/bin/bash #!/bin/bash
project=$1 project=$1


# Give Permissions # Check if main.lua exists:
if [[ ! -f "main.lua" ]]; then
echo -e "\e[31m !! Could not find main.lua file, terminating build process !! \e[0m"
exit 1
fi

# Give Permissions and check for build directory:
chmod +x -R ./.build chmod +x -R ./.build
if [[ ! -d ./.build/builds ]]; then
mkdir ./.build/builds
fi


# Build .love # Build .love
./.build/make-love.sh $project ./.build/make-love.sh $project


# Build .exe # Build .exe
./.build/make-exe.sh $project ./.build/make-exe.sh $project

# End
echo -e "\e[1;33m Finished Building Project! \e[0m"
exit 0

+ 1
- 1
data/starshipTypes.lua 查看文件

@@ -3,7 +3,7 @@ starshipTypes = {
orbiter = { orbiter = {
name = "Classic Orbiter", name = "Classic Orbiter",
description = "Dolor fugiat irure sit aliqua labore. Culpa voluptate occaecat anim exercitation proident sint ex dolor. Officia in labore sint Lorem ea. Ad minim aliqua aliqua non commodo qui in ea sit excepteur excepteur qui.", description = "Dolor fugiat irure sit aliqua labore. Culpa voluptate occaecat anim exercitation proident sint ex dolor. Officia in labore sint Lorem ea. Ad minim aliqua aliqua non commodo qui in ea sit excepteur excepteur qui.",
impacttolerance = 3, impacttolerance = 5,
mass = 1000000, -- idk, feels better but holy fuck thats a thicc ass boi xD mass = 1000000, -- idk, feels better but holy fuck thats a thicc ass boi xD
speed = 0.01, speed = 0.01,
specials = {"orbitSync"}, specials = {"orbitSync"},


+ 19
- 5
src/calc.lua 查看文件

@@ -15,14 +15,26 @@ function calc.debug(text)
end end
end end


function calc.colour(r, g, b) -- Turn 0-1 colour to 0-range (default: 255):
return { r/255, g/255, b/255 } function calc.setColour(r, g, b, a)
end -- Supported Inputs:
-- RGB: (r, g, b, a)
-- Greyscale: (luminance, a)
local range = 255

-- Set g and b value to r if in greyscale and :
if b == nil and a == nil then
a = g
g, b = r, r
end
-- Colour Conversion (0-1 -> 0-range)
r, g, b = r/range, g/range, b/range

-- If alpha not provided, set to 1 by default:
if a == nil then a = 1 end


function calc.c(value) -- Change Draw Colour:
return value/255 love.graphics.setColor(r, g, b, a)
end end


-- Distance Formula: -- Distance Formula:


+ 4
- 4
src/class/Button.lua 查看文件

@@ -13,8 +13,8 @@ function Button:init(tempX, tempY, tempW, tempH, tempText, tempTC, tempBC, tempA
-- Text and Colours: -- Text and Colours:
self.text = tempText self.text = tempText
self.colour = { self.colour = {
text = calc.colour(tempTC[1], tempTC[2], tempTC[3]), text = tempTC,
background = calc.colour(tempBC[1], tempBC[2], tempBC[3]) background = tempBC
} }


-- Click Cooldown: -- Click Cooldown:
@@ -76,11 +76,11 @@ function Button:draw()
end end


-- Draw Background -- Draw Background
love.graphics.setColor(bg[1], bg[2], bg[3]) calc.setColour(bg[1], bg[2], bg[3], bg[4])
love.graphics.rectangle("fill", x, y, w, h) love.graphics.rectangle("fill", x, y, w, h)


-- Draw Text -- Draw Text
love.graphics.setFont(font.default) love.graphics.setFont(font.default)
love.graphics.setColor(tx[1], tx[2], tx[3]) calc.setColour(tx[1], tx[2], tx[3], tx[4])
love.graphics.printf(self.text, x, y+h/8, w, "center") love.graphics.printf(self.text, x, y+h/8, w, "center")
end end

+ 4
- 10
src/class/Menubutton.lua 查看文件

@@ -60,26 +60,20 @@ end
function Menubutton:draw() function Menubutton:draw()
local x, y, w, h = self.x, self.y, self.w, self.h local x, y, w, h = self.x, self.y, self.w, self.h
local bg, tx = self.colour.background, self.colour.text local bg, tx = self.colour.background, self.colour.text
bg, tx = calc.colour(bg[1], bg[2], bg[3]), calc.colour(tx[1], tx[2], tx[3])


-- Hover Effects -- Hover Effects:
if self:hover() then if self:hover() then
-- Slight Colour Lightup -- Slight pop up effect (purly visual):
for i = 1, #bg do
bg[i] = bg[i]*1.1
end

-- Slight pop up effect (purly visual)
local pop = 3 local pop = 3
x, y, w, h = x-pop, y-pop, w+pop*2, h+pop*2 x, y, w, h = x-pop, y-pop, w+pop*2, h+pop*2
end end


-- Draw Background -- Draw Background
love.graphics.setColor(bg[1], bg[2], bg[3]) calc.setColour(bg[1], bg[2], bg[3], bg[4])
love.graphics.rectangle("fill", x, y, w, h) love.graphics.rectangle("fill", x, y, w, h)


-- Draw Text -- Draw Text
love.graphics.setFont(font.default) love.graphics.setFont(font.default)
love.graphics.setColor(tx[1], tx[2], tx[3]) calc.setColour(tx[1], tx[2], tx[3], tx[4])
love.graphics.printf(self.text, x, y, w, "center") love.graphics.printf(self.text, x, y, w, "center")
end end

+ 2
- 2
src/class/Planet.lua 查看文件

@@ -93,8 +93,8 @@ end


function Planet:draw() function Planet:draw()
local col = self.colour local col = self.colour
love.graphics.setColor(calc.c(col[1]), calc.c(col[2]), calc.c(col[3])) calc.setColour(col[1], col[2], col[3], col[4])
love.graphics.circle("fill", self.x, self.y, self.r) love.graphics.circle("fill", self.x, self.y, self.r)
love.graphics.setColor(0.1,0.1,0.1,0.2) love.graphics.setColor(0.1, 0.1, 0.1, 0.2)
love.graphics.circle("fill", self.x, self.y, self.r*2) love.graphics.circle("fill", self.x, self.y, self.r*2)
end end

+ 6
- 6
src/class/Textbox.lua 查看文件

@@ -13,8 +13,8 @@ function Textbox:init(tempX, tempY, tempW, tempH, tempText, tempAlign, tempTC, t


-- Colours: -- Colours:
self.colour = { self.colour = {
text = calc.colour(tempTC[1], tempTC[2], tempTC[3]), text = tempTC,
background = calc.colour(tempBC[1], tempBC[2], tempBC[3]) background = tempBC
} }
end end


@@ -22,16 +22,16 @@ end
-- FUNCTIONS -- FUNCTIONS


function Textbox:drawBox() function Textbox:drawBox()
local c = self.colour.background local col = self.colour.background
love.graphics.setColor(c[1], c[2], c[3], 0.7) calc.setColour(col[1], col[2], col[3], 0.7)
love.graphics.rectangle("fill", self.x, self.y, self.w, self.h) love.graphics.rectangle("fill", self.x, self.y, self.w, self.h)
end end


function Textbox:drawText() function Textbox:drawText()
local border = 3 local border = 3
local c = self.colour.text local col = self.colour.text
love.graphics.setFont(font.default) love.graphics.setFont(font.default)
love.graphics.setColor(c[1], c[2], c[3]) calc.setColour(col[1], col[2], col[3])
love.graphics.printf(self.text, self.x + border, self.y + border, self.w + border*2, self.align) love.graphics.printf(self.text, self.x + border, self.y + border, self.w + border*2, self.align)
end end




||||||
x
 
000:0
正在加载...
取消
保存