Skip to content
This repository has been archived by the owner on Jan 4, 2023. It is now read-only.

Commit

Permalink
Fixed crash when recording gif, removed bounce when walking off ladde…
Browse files Browse the repository at this point in the history
…rs, replaced icon, and created documentation.
  • Loading branch information
jessefreeman committed Oct 6, 2021
1 parent 1142f66 commit 92fa602
Show file tree
Hide file tree
Showing 47 changed files with 244 additions and 170 deletions.
Binary file removed App/Content/Fonts/small.font.png
Binary file not shown.
4 changes: 2 additions & 2 deletions App/Content/PixelVisionOS/Tools/BootTool/code.lua
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ function Init()

DrawText(runnerName, startX, 225, DrawMode.TilemapCache, "large", 11)

DrawText(runnerVer, startX + (#runnerName * 8) + 8, 225, DrawMode.TilemapCache, "small", 11, - 4)
DrawText(runnerVer, startX + (#runnerName * 8) + 8, 225, DrawMode.TilemapCache, "medium", 11, - 4)

-- We want to render the text from the bottom of the screen so we offset it and loop backwards.
for i = 1, total do
Expand Down Expand Up @@ -238,7 +238,7 @@ function KeyPressCheck()
elseif(Key(Keys.LeftShift) or Key(Keys.RightShift)) then
if(safeMode == false) then
safeMode = true
DrawText("SAFE MODE", 8, 225, DrawMode.TilemapCache, "small", 11, - 4)
DrawText("SAFE MODE", 8, 225, DrawMode.TilemapCache, "medium", 11, - 4)

-- Reset the display
Fullscreen(false)
Expand Down
Binary file removed App/Content/PixelVisionOS/Tools/BootTool/tilemap.png
Binary file not shown.
7 changes: 3 additions & 4 deletions App/Content/bios.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"WorkspaceDir" : "Levels",
"Resolution": "512x480",
"LogFilePath": "/User/Log.txt",
"ScreenShotPath": "/User/ScreenShots/",
"ScreenshotPath": "/User/Screenshots/",
"RecordingPath": "/User/Recordings/",
"BootTool": "/PixelVisionOS/Tools/BootTool/",
"LoadTool": "/PixelVisionOS/Tools/LoadTool/",
"ErrorTool": "/PixelVisionOS/Tools/ErrorTool/",
Expand All @@ -12,14 +13,12 @@
"SystemVersion": "v0.0.0",
"FileDiskMounting": "True",
"CRT":"False",
"NoAutoRun":"Could not find an OS to boot. Insert a disk or restart in 'safe mode' by holding down the Shift key.",
"NoAutoRun":"Could not find a game to boot. Visit spacestation8.download to reinstall.",
"NoDefaultTool": "Could not find a default tool to load.",
"Exception": "@{error}\nPress Ctrl + 4 to reload the current game.",
"LoadError": "There was an issue loading from '@{path}'.",
"Warning": "@{error}",

"ArchiveExtensions": "pv8",
"FileExtensions": "png,lua,json,txt,wav,cs",
"RequiredFiles": "info.json"

}
Binary file modified App/Icon.bmp
Binary file not shown.
Binary file modified App/Icon.icns
100755 → 100644
Binary file not shown.
Binary file modified App/Icon.ico
100755 → 100644
Binary file not shown.
Binary file added App/Icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified App/libs/Pixel Vision 8.dll
Binary file not shown.
18 changes: 0 additions & 18 deletions Build/Templates/bios-template.json

This file was deleted.

14 changes: 14 additions & 0 deletions Docs/about.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
![image-20211005232746316](images/disk-icon.png)

**Space Station 8** is a `Mico Platformer` created [in 72 hours for Ludum Dare 49](https://ldjam.com) based on a game I used to play on my original Macintosh called [Spacestation Pheta](https://en.wikipedia.org/wiki/Spacestation_Pheta). Space Station 8 is also heavily inspired by [Bitsy](http://make.bitsy.org) and my Fantasy Console, [Pixel Vision 8](https://pixelvision8.com), which I used to create the game.

![spacestation-pheta](images/spacestation-pheta.png)

The goal of Space Station 8 is to escape before you run out of oxygen. To do that, you will need to navigate the level, find the key, and make it to the exit in time. Each level is self-contained, and you are scored based on your ability to complete it within the amounted time and lives. There are also some prized gems you may want to collect on your way out while avoiding aliens and other deadly obstacles like spikes.

![image-20211005232937002](images/game-screenshot.png)

Like the original game this is based on, there is a built-in map editor. In fact, there are no pre-made maps at all! The twist is that I lost them after space junk hit the station, so I need everyone's help to make new ones and share them with others.

Ready to get started? The documentation will teach you everything you need to know for making, sharing, and playing your Space Station 8 maps.

20 changes: 20 additions & 0 deletions Docs/backlog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
I plan on continuing to clean this up and add new functionality over the next few weeks. You can file bugs here, request features here, and submit new levels here. I plan to add an easier way to load maps and collect some of the best ones to be included as part of the download.

Here is a rundown of all the features I plan on adding:

- Level loading system - A simple way to cycle through levels in the Space Station 8/levels folder.
- Renaming maps - A built-in system for organizing maps.
- Favorite maps - have a way to jump to a collection of maps to play quickly.
- Level collections - make a series of maps to play as a set via some kind of naming convention.
- More sound effects - Add effects for all interactions in the game.
- In-game help - Add some modal or tooltips that tell the player what to do.
- Switches - a way to wire up the switch and link it to something specific.
- ~~Hanging spikes (done) - add support for looking at spike collision when jumping up into them.~~
- Unified physics system - Add support for an entity to run in the player's physics engine.
- Abstract out player - Make player and entities work the same way in the physics engine.
- Clean up code - remove old code, condense logic to share, and document.
- Port to C# - Make a C# version of the game once the Lua one is finished.
- ~~Wiki - move docs into a wiki.~~
- ~~New icon - Create a custom icon for the exe.~~
- Dedicated site - Build a github.io page for the game.
- Add to itch.io - Create a permanent place for people to find and download.
48 changes: 48 additions & 0 deletions Docs/controls.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
Pixel Vision 8 supports a keyboard, mouse, and controller. Space Station 8 supports all three but was designed around the controller mapping. You can modify the mapping at any time by hitting `ESC` and going into the settings.

![image-20211005233314131](images/controller-mapping.png)

Here are all the input options based on what screen you are on:

## Splash

![image-20211005233845490](images/splash-screenshot.png)

| Action | Keyboard | Mouse | Controller | Note |
| ------ | -------- | ----- | ---------- | ---- |
| Start | S | N/A | Start ||
| Settings | ESC | N/A | N/A | Works on every screen |



## Editor

![image-20211005233910369](images/editor-screenshot.png)

| Action | Keybaord | Mouse | Controller | Note |
| ------ | -------- | ----- | ---------- | ---- |
| Play | S | N/A | Start | Hold for 3 seconds |
| Quit | A + S | N/A | Select + Start | Hold for 3 seconds |
| Up | Up Arrow | Move Up | Up | Mouse shows up when moving |
| Down | Down Arrow | Move Down | Down | Mouse shows up when moving |
|Left | Left Arrow | Move Left | Left | Mouse shows up when moving |
| Right | Right Arrow | Move Right | Right | Mouse shows up when moving |
| Tile | A | Click on Tile | Select | Cycles to the next tile |
| Paint | X | Left-Click | A | Draws tile |
| Flip | C | Right-Click | B | Flips the tile if it can be |



## Game

![image-20211005232937002](images/game-screenshot.png)

| Action | Keybaord | Mouse | Controller | Note |
| ------ | -------- | ----- | ---------- | ---- |
| Quit | A | N/A | Select | Hold for 3 seconds |
| Up | Up Arrow |N/A | Up | Moves up ladders |
| Down | Down Arrow | N/A | Down | Moves down ladders |
| Left | Left Arrow | N/A | Left ||
| Right | Right Arrow | N/A | Right ||
| Jump | X | N/A | A ||
| Jump | C | N/A | B ||
34 changes: 34 additions & 0 deletions Docs/editing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
When you first load Space Station 8 up, you will be presented with the default map. You can immediately begin editing it, or you can drag a `spacestation8.png` map onto the game and load that up.

![CleanShot 2021-10-05 at 22.41.55](images/drag-map.gif)



Space Station 8 map's should be at least `160` x `132` pixels:

![CleanShot 2021-10-05 at 22.33.15](images/empty-map-160x132.png)

You can also provide a map that is `160` x `152`, where the last two rows are the sprites for the map:

![CleanShot 2021-10-05 at 22.44.25](images/empty-map-160x152.png)

Whenever you go to the splash screen, Space Station 5 will automatically create a new `map.spacestation8.png` for you in your `/Levels/` folder:
| Version | Path |
| ------- | ------------------------------------------------------ |
| Windows | C:\\Users\\UserName\\Documents\\SpaceStation8\Levels\\ |
| MacOS | /Users/UserName/PixelVision8/SpaceStation8/Levels/ |
| Linux | /Users/UserName/PixelVision8/SpaceStation8/Levels/ |

Before you can play a map, you'll be taken to the map editor. The editor has two main areas, the map and the tile picker on the bottom:

![image-20211005225512619](images/map-editor-panels.png)

The white blinking box in the map area previews where the tile will be drawn. You can move the tile highlighter via a controller's d-pad, the keyboard arrows, or the mouse. By default, the mouse is hidden unless you move it.

![recording3-export_2x](images/move-mouse-in-editor.gif)

You can pick from any of the 20 tiles on the bottom of the screen to draw with. The tile with the white background is the currently selected tile. You'll also see it previewed on the map. Some tiles have a flip or alternative state. This can be used for changing the direction of an enemy or spikes.

![recording4-export_4x](images/map-editor-alt-tiles.gif)

Finally, for a map to work, you need three things: a player, a key, and a door. When you start the game, if these things are not present, it will bring you back to the editor. There is no cap on how many players, keys, or doors you can draw on the map, but the game will only use the first of each when it processes all the tiles.
Binary file added Docs/images/controller-mapping.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Docs/images/disk-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Docs/images/drag-map.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Docs/images/editor-screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Docs/images/empty-map-160x132.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Docs/images/empty-map-160x152.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Docs/images/game-screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Docs/images/github-map-issue.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Docs/images/map-editor-alt-tiles.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Docs/images/map-editor-panels.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Docs/images/map-sprites.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Docs/images/map-template.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Docs/images/move-mouse-in-editor.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Docs/images/palette.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Docs/images/play-map.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Docs/images/spacestation-pheta.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Docs/images/splash-screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Docs/images/sprite-alien.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Docs/images/sprite-door.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Docs/images/sprite-gem.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Docs/images/sprite-key.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Docs/images/sprite-ladder.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Docs/images/sprite-paltform.png
Binary file added Docs/images/sprite-spikes.png
Binary file added Docs/images/sprite-switch.png
15 changes: 15 additions & 0 deletions Docs/playing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Once you start the level, you have to make your way to the exit before running out of oxygen. To open the door, you will need to find the key then walk through the door:

![play-map](images/play-map.gif)

Along the way, you will have to avoid the following collectibles and hazards:
| Sprite | Name | Value | Description |
| ---- | ---- | --- | --- |
| ![image-20211005235506198](images/sprite-alien.png) | Alien | N/A | Avoid these guys, or they will instantly kill you. |
| ![image-20211005235349987](images/sprite-door.png) | Door | 500 pts | Starts as locked and will unlock once you pick up the key. |
| ![Key](images/sprite-key.png) | Key | 50 pts | Opens the door to escape. |
| ![image-20211005235444490](images/sprite-gem.png) | Gem | 100 pts | Collect this for extra points. |
| ![image-20211005235609503](images/sprite-ladder.png) | Ladder | N/A | Allows you to walk up and down. |
| ![image-20211005235631848](images/sprite-paltform.png) | Platform | N/A | Allows you to jump onto from below and drop down from when on. |
| ![image-20211005235529533](images/sprite-spikes.png) | Spikes | N/A | Spikes will kill you if you land or jump on one. You can walk past spikes without taking damage. |
| ![image-20211005235546394](images/sprite-switch.png) | Switch | N/A | This is not implemented yet. |
20 changes: 20 additions & 0 deletions Docs/sharing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Once you are happy with a level, you can share it with someone else by sending them the `map.spacestation8.png` file. There are several ways to do this. You can attach it in a comment below, send it directly to them, or [file a ticket on GitHub](https://github.com/PixelVision8/SpaceStation8/issues/new?assignees=jessefreeman&labels=map&template=new_map.md&title=) and include it there.

![CleanShot 2021-10-06 at 00.05.15](images/github-map-issue.png)

One thing to note is that some social networks like Twitter may compress the image. This will break the tilemap parser unless the image is pixel-perfect at 160 x 132 or 160 x 142.

The default map template looks like this:

![map.spacestation8](images/map-template.png)

As you can see, a map is comprised of a `20` x `17` tile grid where each tile is `8` x `8` pixels. The top row is ignored, and for map images that are `142` pixels high, the last two rows (`18` and `19`) are used for the game's sprites.

![image-20211006001050340](images/map-sprites.png)

There are `40` sprites which you can also modify if you want to reskin the game. Each sprite is fixed to a corresponding element in the game, so while you can re-skin the graphics, you will not make new ones or change the internal sprite mapping.

The last thing to keep in mind when modifying the sprites, or even using a drawing too like [Aseprite](https://www.aseprite.org) to modify map files, is that you will have to use the following four colors (`#2D1B2E`, `#574B67`, `#937AC5`, #F9F4EA) .

![image-20211006001341443](images/palette.png)

63 changes: 24 additions & 39 deletions Game/Src/micro-platformer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,6 @@
Update to PV8 v1.5 API by Jesse Freeman (@jessefreeman | http://pixelvision8.com)
]]--

--[[
The goal of this cart is to demonstrate a very basic
platforming engine in under 100 lines of *code*, while
still maintaining an organized and documented game.
It isn't meant to be a demo of doing as much as possible, in
as little code as possible. The 100 line limit is just
meant to encourage people to realize "You can make a game
with very little coding!"
This will hopefully give new users a simple and easy to
understand starting point for their own platforming games.
Note: Collision routine is based on mario bros 2 and
mckids, where we use collision points rather than a box.
this has some interesting bugs but if it was good enough for
miyamoto, its good enough for me!
--]]

MicroPlatformer = {}
MicroPlatformer.__index = MicroPlatformer

Expand Down Expand Up @@ -69,26 +50,19 @@ function MicroPlatformer:Update(timeDelta)

local hitRect = self.player.hitRect


-- get the scroll position
-- local scrollPos = ScrollPosition()

local center = hitRect.Center
local forward = NewPoint(self.player.dir == false and (hitRect.Right -1) or (hitRect.Left + 1), center.Y)
local bottom = NewPoint(center.X, hitRect.Bottom + 1)
local bottom = NewPoint(center.X, hitRect.Bottom)
local top = NewPoint(center.X, hitRect.Top - 1)

-- DrawRect(center.X, center.Y, 1, 1, 3, DrawMode.SpriteAbove)
-- DrawRect(forward.X, forward.Y, 1, 1, 3, DrawMode.SpriteAbove)

-- DrawRect(bottom.X, bottom.Y, 1, 1, 3, DrawMode.SpriteAbove)
-- DrawRect(top.X, top.Y, 1, 1, 3, DrawMode.SpriteAbove)


-- Keep track of all the collision areas around the player
self.currentFlagPos = NewPoint(math.floor(center.X/8), math.floor(center.Y/8))
self.currentFlag = Flag(self.currentFlagPos.X, self.currentFlagPos.Y)

-- DrawRect(math.floor(center.X/8) * 8, math.floor(center.Y/8) * 8, 8, 8, 9, DrawMode.SpriteBelow)


local grav = self.grav

Expand Down Expand Up @@ -175,14 +149,11 @@ function MicroPlatformer:Update(timeDelta)
--player.
local bottomFlag = Flag(math.floor(bottom.X/8), math.floor(bottom.Y/8))

-- print(bottomFlag, self.player.hitRect)

-- DrawRect(math.floor(bottom.X/8) * 8, math.floor(bottom.Y/8) * 8, 8, 8, 1, DrawMode.SpriteBelow)

--look for a solid tile
if (bottomFlag == SPIKE or self.player.hitRect.Y > (Display().Y - 16)) then

-- print("Kill Player")

self.player.alive = false

Expand All @@ -196,14 +167,24 @@ function MicroPlatformer:Update(timeDelta)
--allow jumping again
self.player.isgrounded = true

if(Button(Buttons.Down) and bottomFlag == PLATFORM) then
-- if(Button(Buttons.Down) and bottomFlag == PLATFORM) then
-- self.player.hitRect.Y = self.player.hitRect.Y + 10
-- end

self.player.hitRect.Y = self.player.hitRect.Y + 10
elseif(bottomFlag == LADDER and self.currentFlag ~= LADDER) then

end
-- self.player.hitRect.Y = math.floor((self.player.hitRect.Y) / 8) * 8
self.player.isgrounded = true

-- DrawRect(math.floor(testX) * 8, math.floor(testY) * 8, 8, 8, 1, DrawMode.SpriteBelow)

self.player.dy = 0

if(Button(Buttons.Down)) then
self.player.hitRect.Y = self.player.hitRect.Y + 1
-- else
-- self.player.hitRect.Y = bottom.Y-1
-- self.player.dy = 0
end

elseif (bottomFlag == LADDER and Button(Buttons.Down) == false ) then


Expand Down Expand Up @@ -236,6 +217,11 @@ function MicroPlatformer:Update(timeDelta)
self.player.hitRect.Y = math.floor((self.player.hitRect.Y + 8) / 8) * 8
--halt upward velocity
self.player.dy = 0
--look for solid tile
elseif (topFlag == SPIKE) then
--position self.player right below
--ceiling
self.player.alive = false

end
end
Expand Down Expand Up @@ -284,7 +270,6 @@ function MicroPlatformer:Update(timeDelta)
self.player.spriteID = PLAYER_WALK + self.player.spriteOffset

else

-- Idle so use the first sprite
self.player.spriteID = PLAYER_IDLE + self.player.spriteOffset
end
Expand Down
Loading

0 comments on commit 92fa602

Please sign in to comment.