diff --git a/assets/sprites/ship_2.png b/assets/sprites/ship_2.png
new file mode 100644
index 0000000..c8dfcca
Binary files /dev/null and b/assets/sprites/ship_2.png differ
diff --git a/assets/sprites/ship_big.png b/assets/sprites/ship_big.png
new file mode 100644
index 0000000..83317a2
Binary files /dev/null and b/assets/sprites/ship_big.png differ
diff --git a/assets/sprites/ship_green.png b/assets/sprites/ship_green.png
new file mode 100644
index 0000000..39f8d56
Binary files /dev/null and b/assets/sprites/ship_green.png differ
diff --git a/assets/sprites/ship_purple.png b/assets/sprites/ship_purple.png
new file mode 100644
index 0000000..5095c97
Binary files /dev/null and b/assets/sprites/ship_purple.png differ
diff --git a/assets/sprites/ship_shuttle.png b/assets/sprites/ship_shuttle.png
new file mode 100644
index 0000000..631f2f8
Binary files /dev/null and b/assets/sprites/ship_shuttle.png differ
diff --git a/assets/sprites/ship_shuttle_2.png b/assets/sprites/ship_shuttle_2.png
new file mode 100644
index 0000000..e34d831
Binary files /dev/null and b/assets/sprites/ship_shuttle_2.png differ
diff --git a/assets/sprites/ship_ufo.png b/assets/sprites/ship_ufo.png
new file mode 100644
index 0000000..80abacf
Binary files /dev/null and b/assets/sprites/ship_ufo.png differ
diff --git a/entities/player.lua b/entities/player.lua
index 7f71276..ab24a77 100644
--- a/entities/player.lua
+++ b/entities/player.lua
@@ -1,6 +1,17 @@
--local sounds = require 'services/sounds'
+local shipList = require('ships/shipList')
+
+-- Returns the ship's attribute table based on index (shipList.lua) - J.R.C 2/2/22
+local function get_ship(index)
+ if index == nil then
+ index = 1 -- Defaults to Trevor's OG ship if none is found in the map props.
+ end
+ return shipList[index]
+end
return function(props)
+ local ship_index = tonumber(props.ship_type)
+ local ship = get_ship(ship_index)
return {
body = {
mass = 1
@@ -22,20 +33,7 @@ return function(props)
},
gravitational_mass = 1,
isControlled = true,
- shape = {
- points = {
- 0, -25,
- -25, 2,
- -25, 25,
- 25, 2,
- 25, 25
- },
- type = 'polygon'
- },
- spritesheet = {
- image = 'spaceship',
- offset_x = 12.5,
- scale_x = 2
- }
+ shape = ship.shape,
+ spritesheet = ship.spritesheet
}
end
diff --git a/maps/mapList.lua b/maps/mapList.lua
index 30ebe96..eb91daa 100644
--- a/maps/mapList.lua
+++ b/maps/mapList.lua
@@ -19,7 +19,37 @@ return {
},
{
displayName = 'No Planets',
- filename = 'noPlanet',
+ filename = 'no_planets',
thumbnail = nil
- }
+ },
+ {
+ displayName = 'ship_1',
+ filename = 'ship_1',
+ thumbnail = nil
+ },
+ {
+ displayName = 'ship_2',
+ filename = 'ship_2',
+ thumbnail = nil
+ },
+ {
+ displayName = 'ship_ufo',
+ filename = 'ship_ufo',
+ thumbnail = nil
+ },
+ {
+ displayName = 'ship_shuttle_1',
+ filename = 'ship_shuttle_1',
+ thumbnail = nil
+ },
+ {
+ displayName = 'ship_shuttle_2',
+ filename = 'ship_shuttle_2',
+ thumbnail = nil
+ },
+ {
+ displayName = 'BIG MAP',
+ filename = 'mp_big',
+ thumbnail = nil
+ },
}
diff --git a/maps/mp_big.tmx b/maps/mp_big.tmx
new file mode 100644
index 0000000..d6fd926
--- /dev/null
+++ b/maps/mp_big.tmx
@@ -0,0 +1,277 @@
+
+
diff --git a/maps/noPlanet.tmx b/maps/no_planets.tmx
similarity index 99%
rename from maps/noPlanet.tmx
rename to maps/no_planets.tmx
index 1facd13..27a6a8e 100644
--- a/maps/noPlanet.tmx
+++ b/maps/no_planets.tmx
@@ -31,6 +31,7 @@
diff --git a/maps/ship_1.tmx b/maps/ship_1.tmx
new file mode 100644
index 0000000..72cc169
--- /dev/null
+++ b/maps/ship_1.tmx
@@ -0,0 +1,17 @@
+
+
diff --git a/maps/ship_2.tmx b/maps/ship_2.tmx
new file mode 100644
index 0000000..88d23ce
--- /dev/null
+++ b/maps/ship_2.tmx
@@ -0,0 +1,17 @@
+
+
diff --git a/maps/ship_not_stolen.tmx b/maps/ship_not_stolen.tmx
new file mode 100644
index 0000000..8211570
--- /dev/null
+++ b/maps/ship_not_stolen.tmx
@@ -0,0 +1,17 @@
+
+
diff --git a/maps/ship_shuttle_1.tmx b/maps/ship_shuttle_1.tmx
new file mode 100644
index 0000000..8286dac
--- /dev/null
+++ b/maps/ship_shuttle_1.tmx
@@ -0,0 +1,17 @@
+
+
diff --git a/maps/ship_shuttle_2.tmx b/maps/ship_shuttle_2.tmx
new file mode 100644
index 0000000..7920c8c
--- /dev/null
+++ b/maps/ship_shuttle_2.tmx
@@ -0,0 +1,17 @@
+
+
diff --git a/maps/ship_ufo.tmx b/maps/ship_ufo.tmx
new file mode 100644
index 0000000..6f38ad7
--- /dev/null
+++ b/maps/ship_ufo.tmx
@@ -0,0 +1,17 @@
+
+
diff --git a/services/textures.lua b/services/textures.lua
index ca58590..56dc82d 100644
--- a/services/textures.lua
+++ b/services/textures.lua
@@ -12,6 +12,15 @@ textures.load = function()
textures.star = i 'star.png'
textures.planet = i 'planet.png'
textures.speedboost = i 'speedboost.png'
+
+ -- Assorted spaceships by Jon
+ textures.ship_2 = i 'ship_2.png' -- Ship Index 2
+ textures.ship_ufo = i 'ship_ufo.png' -- Ship Index 3
+ textures.ship_shuttle = i 'ship_shuttle.png' -- Ship Index 4
+ textures.ship_shuttle_2 = i 'ship_shuttle_2.png' -- Ship Index 5
+ textures.ship_purple = i 'ship_purple.png' -- Ship Index 6
+ textures.ship_green = i 'ship_green.png' -- Ship Index 7
+ textures.ship_big = i 'ship_big.png' -- Ship Index 8
end
return textures
diff --git a/ships/shipList.lua b/ships/shipList.lua
new file mode 100644
index 0000000..d762e37
--- /dev/null
+++ b/ships/shipList.lua
@@ -0,0 +1,169 @@
+--[[
+ This is a table of all ships available
+ All ships have a:
+ displayName - The display name of the ship.
+ filename - The filename of the ship sprite
+ shape with:
+ points
+ type
+ spritesheet with:
+ image
+ offset_x
+ scale_x
+
+ - J.R.C 2/1/22
+]]
+return {
+ [1] = {
+ displayName = 'Trevor\'s OG Ship', -- Index 1
+ filename = 'ship',
+ shape = {
+ points = {
+ 0, -25,
+ -25, 2,
+ -25, 25,
+ 25, 2,
+ 25, 25
+ },
+ type = 'polygon'
+ },
+ spritesheet = {
+ image = 'spaceship',
+ offset_x = 12.5,
+ scale_x = 2
+ }
+ },
+ [2] = {
+ displayName = 'Ship Two', -- Index 2
+ filename = 'ship_2',
+ shape = {
+ points = {
+ 0, -25,
+ -25, 2,
+ -25, 25,
+ 25, 2,
+ 25, 25
+ },
+ type = 'polygon'
+ },
+ spritesheet = {
+ image = 'ship_2',
+ offset_x = 12.5,
+ scale_x = 2
+ }
+ },
+ [3] = {
+ displayName = 'UFO', -- Index 3
+ filename = 'ship_ufo',
+ shape = {
+ points = {
+ 0, -25,
+ -25, 2,
+ -25, 15,
+ 25, 2,
+ 25, 15
+ },
+ type = 'polygon'
+ },
+ spritesheet = {
+ image = 'ship_ufo',
+ offset_x = 12.5,
+ scale_x = 2
+ }
+ },
+ [4] = {
+ displayName = 'Shuttle Rocket', -- Index 4
+ filename = 'ship_shuttle',
+ shape = {
+ points = {
+ 0, -32,
+ -15, -15,
+ -15, 32,
+ 15, -15,
+ 15, 32
+ },
+ type = 'polygon'
+ },
+ spritesheet = {
+ image = 'ship_shuttle',
+ offset_x = 16,
+ scale_x = 2
+ }
+ },
+ [5] = {
+ displayName = 'Shuttle', -- Index 5
+ filename = 'ship_shuttle_2',
+ shape = {
+ points = {
+ 0, -32,
+ -15, 15,
+ -15, 32,
+ 15, 15,
+ 15, 32
+ },
+ type = 'polygon'
+ },
+ spritesheet = {
+ image = 'ship_shuttle_2',
+ offset_x = 16,
+ scale_x = 2
+ }
+ },
+ [6] = {
+ displayName = 'Purple', -- Index 6
+ filename = 'ship_purple',
+ shape = {
+ points = {
+ 0, -26,
+ -15, 15,
+ -15, 16,
+ 15, 15,
+ 15, 16
+ },
+ type = 'polygon'
+ },
+ spritesheet = {
+ image = 'ship_purple',
+ offset_x = 16,
+ scale_x = 1
+ }
+ },
+ [7] = {
+ displayName = 'Green', -- Index 7
+ filename = 'ship_green',
+ shape = {
+ points = {
+ 0, -26,
+ -15, 15,
+ -15, 16,
+ 15, 15,
+ 15, 16
+ },
+ type = 'polygon'
+ },
+ spritesheet = {
+ image = 'ship_green',
+ offset_x = 16,
+ scale_x = 1
+ }
+ },
+ [8] = {
+ displayName = 'Big One', -- Index 8
+ filename = 'ship_big',
+ shape = {
+ points = {
+ 0, -45,
+ -32, 32,
+ -32, 32,
+ 32, 32,
+ 32, 32
+ },
+ type = 'polygon'
+ },
+ spritesheet = {
+ image = 'ship_big',
+ offset_x = 32,
+ scale_x = 1
+ }
+ }
+}
diff --git a/systems/DebugPlayer.lua b/systems/DebugPlayer.lua
index 619844a..9058cc7 100644
--- a/systems/DebugPlayer.lua
+++ b/systems/DebugPlayer.lua
@@ -46,7 +46,7 @@ local function debug(entity)
-- Actually Draw the Line
love.graphics.setColor({ 1, 0, 0, 1 })
love.graphics.line(entity.body:getX(), entity.body:getY(), velocityArrowX,velocityArrowY)
-
+ love.graphics.setColor({ 1, 1, 1, 1 }) -- Added this line to fix sprite drawing as red - J.R.C 2/2/22
end
end