Skip to content

Commit

Permalink
Initial commit / Project upload
Browse files Browse the repository at this point in the history
  • Loading branch information
PizzaFuel committed Dec 20, 2022
1 parent 54a7eee commit c01b0dd
Show file tree
Hide file tree
Showing 25 changed files with 973 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Compiled Lua sources
luac.out

# luarocks build files
*.src.rock
*.zip
*.tar.gz

# Object files
*.o
*.os
*.ko
*.obj
*.elf

# Precompiled Headers
*.gch
*.pch

# Libraries
*.lib
*.a
*.la
*.lo
*.def
*.exp

# Shared objects (inc. Windows DLLs)
*.dll
*.so
*.so.*
*.dylib

# Executables
*.exe
*.out
*.app
*.i*86
*.x86_64
*.hex

# Builds and Code Editor
builds/
.sentry-native/
6 changes: 6 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"recommendations": [
"sumneko.lua",
"jep-a.lua-plus"
]
}
10 changes: 10 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"Lua.runtime.version": "Lua 5.4",
"Lua.diagnostics.disable": ["undefined-global", "lowercase-global"],
"Lua.diagnostics.globals": ["playdate", "import"],
"Lua.runtime.nonstandardSymbol": ["+=", "-=", "*=", "/="],
"Lua.workspace.library": ["$PLAYDATE_SDK_PATH/CoreLibs"],
"Lua.workspace.preloadFileSize": 1000,
"terminal.integrated.defaultProfile.windows": "PowerShell",
"Lua.runtime.unicodeName": true
}
77 changes: 77 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "Invoke Build and Run script",
"type": "shell",
"command": "&",
"args": [
"${workspaceFolder}\\Build and Run (Simulator).ps1",
"-build",
"'${workspaceFolder}\\builds'",
"-source",
"'${workspaceFolder}\\source'",
"-name",
"'${workspaceFolderBasename}'"
],
"presentation": {
"showReuseMessage": false,
"reveal": "always",
"panel": "shared"
}
},
{
"label": "Invoke Run script",
"type": "shell",
"command": "&",
"args": [
"${workspaceFolder}\\Build and Run (Simulator).ps1",
"-build",
"'${workspaceFolder}\\builds'",
"-source",
"'${workspaceFolder}\\source'",
"-name",
"'${workspaceFolderBasename}'",
"-dontbuild"
],
"presentation": {
"showReuseMessage": false,
"reveal": "always",
"panel": "shared"
}
},
{
"label": "Build and Run (Simulator)",
"dependsOn": ["Invoke Build and Run script"],
"dependsOrder": "sequence",
"presentation": {
"showReuseMessage": false,
"reveal": "always",
"panel": "shared"
},
"problemMatcher": [],
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "Run (Simulator)",
"dependsOn": ["Invoke Run script"],
"dependsOrder": "sequence",
"presentation": {
"showReuseMessage": false,
"reveal": "always",
"panel": "shared"
},
"problemMatcher": [],
"group": {
"kind": "test",
"isDefault": true
}
}
]
}

53 changes: 53 additions & 0 deletions ADD_ENV_VARIABLE.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
@echo off
:: CHANGE PATH HERE
:: Replace YOUR CUSTOM SDK PATH HERE with your custom path.
:: Use \ as separator
:: Must not end with \
set SDKPATH="YOUR CUSTOM SDK PATH HERE"


if %SDKPATH% == "YOUR CUSTOM SDK PATH HERE" (
FOR /F "tokens=2* skip=2" %%a in ('reg query "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "Personal"') do set SDKPATH=%%b\PlaydateSDK
)
:: BatchGotAdmin
:-------------------------------------
REM --> Check for permissions
IF "%PROCESSOR_ARCHITECTURE%" EQU "amd64" (
>nul 2>&1 "%SYSTEMROOT%\SysWOW64\cacls.exe" "%SYSTEMROOT%\SysWOW64\config\system"
) ELSE (
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
)

REM --> If error flag set, we do not have admin.
if '%errorlevel%' NEQ '0' (
echo Requesting administrative privileges...
goto UACPrompt
) else ( goto gotAdmin )

:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
set params= %*
echo UAC.ShellExecute "cmd.exe", "/c ""%~s0"" %params:"=""%", "", "runas", 1 >> "%temp%\getadmin.vbs"

"%temp%\getadmin.vbs"
del "%temp%\getadmin.vbs"
exit /B

:gotAdmin
pushd "%CD%"
CD /D "%~dp0"
:--------------------------------------

:: Add PLAYDATE_SDK_PATH env variable
setx /M PLAYDATE_SDK_PATH "%SDKPATH%" 2> nul
:: Add pcd.exe to the PATH env variable
set pathkey="HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment"
for %%p in (pdc.exe) do (set pdcCheck=%%~$PATH:p)
if not defined pdcCheck (
for /F "usebackq skip=2 tokens=2*" %%A IN (`reg query %pathkey% /v Path`) do (reg add %pathkey% /f /v Path /t REG_SZ /d "%%B;%SDKPATH%\bin")
)
:: Update register
powershell -command "& {$md=\"[DllImport(`\"user32.dll\"\",SetLastError=true,CharSet=CharSet.Auto)]public static extern IntPtr SendMessageTimeout(IntPtr hWnd,uint Msg,UIntPtr wParam,string lParam,uint fuFlags,uint uTimeout,out UIntPtr lpdwResult);\"; $sm=Add-Type -MemberDefinition $md -Name NativeMethods -Namespace Win32 -PassThru;$result=[uintptr]::zero;$sm::SendMessageTimeout(0xffff,0x001A,[uintptr]::Zero,\"Environment\",2,5000,[ref]$result)}"
echo SUCCESS!
pause
exit
47 changes: 47 additions & 0 deletions Build and Run (Simulator).ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
param (
[string]$build = ".\builds",
[string]$source = ".\source",
[string]$name = (Get-Item -Path .).BaseName,
[switch]$dontbuild = $false
)
$pdx = Join-Path -Path "$build" -ChildPath "$name.pdx"

# Create build folder if not present
if (!$dontbuild)
{
New-Item -ItemType Directory -Force -Path "$build"
}

# Clean build folder
if (!$dontbuild)
{
Remove-Item "$build\*" -Recurse -Force
}

# Build
if (!$dontbuild)
{
pdc -sdkpath "$Env:PLAYDATE_SDK_PATH" "$source" "$pdx"
}

# Close Simulator
$sim = Get-Process "PlaydateSimulator" -ErrorAction SilentlyContinue

if ($sim)
{
$sim.CloseMainWindow()
$count = 0
while (!$sim.HasExited)
{
Start-Sleep -Milliseconds 10
$count += 1

if ($count -ge 5)
{
$sim | Stop-Process -Force
}
}
}

# Run (Simulator)
& "$Env:PLAYDATE_SDK_PATH\bin\PlaydateSimulator.exe" "$pdx"
44 changes: 44 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Link's Awakening Overworld (Demo) for Playdate
![Link in fron of Egg](demoimages/egg.png)

## First things first
This code was provided unter the [MIT License](LICENSE). If you implement this code into one of your projects, then please credit me in some way.

This is a Fan Project and not related to Nintendo in any way. Please support the [official release](https://www.nintendo.com/store/products/the-legend-of-zelda-links-awakening-switch/)!


## Download / Install
You can download the pdx of this project to sideload [here](Links-Awakening-Overworld-Download.zip).

A guide on how to sideload this game can be found [here](https://help.play.date/games/sideloading/).

![Link on the starting beach](demoimages/sea.png)

## The project
This is a demo of a static verison of Link's Awakenings overworld running on the playdate.

Walk with the D-Pad and sprint using the B-Button.

There are currently no collisions, so you can just walk around the world and enjoy it without boundaries.

![Link walking to the egg](demoimages/walking.gif)

This demo works with a variable framerate and solid 49 fps on device. By replacing the images under source/images/assets you could also get Pokémon Red/Blue/Yellows map or any other games map running.


## Assets and tools used:

- [Song used made by The Accordion Guy](https://www.youtube.com/watch?v=Xp6UEZFfPbs)
- [Source of the map provided by Donut Jacky on Pintrest](https://www.pinterest.ch/pin/798896421383750450/)
- [Link Sprites provided by
ProfessorCreepyPasta on deviantart](https://www.deviantart.com/professorcreepypasta/art/Link-s-Awakening-Link-Sprites-for-RPG-Maker-MV-826890016)
- [AnimatedSprite by Whitebrim
](https://github.com/Whitebrim/AnimatedSprite/wiki)
- [VSCode-PlaydateTemplate by Whitebrim](https://github.com/Whitebrim/VSCode-PlaydateTemplate)
- [Dithering of the map using Ditherlicious](https://29a.ch/ditherlicious/)


## Collaborations
If you wanna continue developing this, then hit me up on [Twitter @PizzaFuelDev](https://twitter.com/PizzaFuelDev) or on the Playdate Squad Discord.

![Game running on Playdate](demoimages/playdate.png)
Binary file added demoimages/egg.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 demoimages/playdate.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 demoimages/sea.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 demoimages/walking.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 source/images/assets/map.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 source/images/assets/player/walk/down.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 source/images/assets/player/walk/left.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 source/images/assets/player/walk/right.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 source/images/assets/player/walk/up.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 source/images/cards/card.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit c01b0dd

Please sign in to comment.