3 Révisions

17 fichiers modifiés avec 71 ajouts et 37 suppressions
  1. +0
    -2
      .build/builds/readme.txt
  2. +19
    -5
      .build/make-exe.sh
  3. +2
    -1
      .build/make-love.sh
  4. BIN
      .build/win/OpenAL32.dll
  5. BIN
      .build/win/SDL2.dll
  6. BIN
      .build/win/love.dll
  7. BIN
      .build/win/lua51.dll
  8. BIN
      .build/win/mpg123.dll
  9. BIN
      .build/win/msvcp120.dll
  10. BIN
      .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 Voir le fichier

@@ -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 Voir le fichier

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

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

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

# 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 Voir le fichier

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

BIN
.build/win/OpenAL32.dll Voir le fichier


BIN
.build/win/SDL2.dll Voir le fichier


BIN
.build/win/love.dll Voir le fichier


BIN
.build/win/lua51.dll Voir le fichier


BIN
.build/win/mpg123.dll Voir le fichier


BIN
.build/win/msvcp120.dll Voir le fichier


BIN
.build/win/msvcr120.dll Voir le fichier


+ 14
- 1
build.sh Voir le fichier

@@ -1,11 +1,24 @@
#!/bin/bash
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
if [[ ! -d ./.build/builds ]]; then
mkdir ./.build/builds
fi

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

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

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

+ 1
- 1
data/starshipTypes.lua Voir le fichier

@@ -3,7 +3,7 @@ starshipTypes = {
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.",
impacttolerance = 3,
impacttolerance = 5,
mass = 1000000, -- idk, feels better but holy fuck thats a thicc ass boi xD
speed = 0.01,
specials = {"orbitSync"},


+ 19
- 5
src/calc.lua Voir le fichier

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

function calc.colour(r, g, b)
return { r/255, g/255, b/255 }
end
-- Turn 0-1 colour to 0-range (default: 255):
function calc.setColour(r, g, b, a)
-- 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)
return value/255
-- Change Draw Colour:
love.graphics.setColor(r, g, b, a)
end

-- Distance Formula:


+ 4
- 4
src/class/Button.lua Voir le fichier

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

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

-- 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)

-- Draw Text
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")
end

+ 4
- 10
src/class/Menubutton.lua Voir le fichier

@@ -60,26 +60,20 @@ end
function Menubutton:draw()
local x, y, w, h = self.x, self.y, self.w, self.h
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
-- Slight Colour Lightup
for i = 1, #bg do
bg[i] = bg[i]*1.1
end

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

-- 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)

-- Draw Text
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")
end

+ 2
- 2
src/class/Planet.lua Voir le fichier

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

function Planet:draw()
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.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)
end

+ 6
- 6
src/class/Textbox.lua Voir le fichier

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

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

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

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

function Textbox:drawText()
local border = 3
local c = self.colour.text
local col = self.colour.text
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)
end



Chargement…
Annuler
Enregistrer