Skip to content

Commit

Permalink
ready to share
Browse files Browse the repository at this point in the history
  • Loading branch information
JamieFristrom committed Dec 1, 2019
0 parents commit 45ab653
Show file tree
Hide file tree
Showing 262 changed files with 32,433 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"parser": "@typescript-eslint/parser",
"parserOptions": {
"jsx": true,
"useJSXTextNode": true,
"ecmaVersion": 2018,
"sourceType": "module",
"project": "./tsconfig.json"
},
"plugins": [
"roblox-ts",
"@typescript-eslint",
"@typescript-eslint/eslint-plugin"
],
"extends": [
"plugin:@typescript-eslint/recommended",
"prettier/@typescript-eslint",
"plugin:roblox-ts/recommended"
],
"rules": {
"@typescript-eslint/array-type": [
"warn",
{
"default": "generic",
"readonly": "generic"
}
],
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-namespace": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-empty-function": "warn",
"prefer-const": "warn",
"no-undef-init": "error"
}
}
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.rbxl filter=lfs diff=lfs merge=lfs -text
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# ignore the out directory
/out/*
include/RuntimeLib.lua
*.map
*.lock
backend/node_modules/*
backend/out/*
node_modules/*
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "roblox-ts"]
path = roblox-ts
url = https://github.com/JamieFristrom/roblox-ts
28 changes: 28 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
MIT License plus Attribution

Copyright (c) 2019 Jamie Fristrom

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

If used in a Roblox Game, include the following attribution in the Game's Place
Description. Or, if some part of it is put in the Roblox Library, include the
following attribution in the item's Description.

Attribution:
Made with Dungeon Life by Jamie Fristrom https://www.roblox.com/games/2184151436

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
65 changes: 65 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# dungeon life

Let me get this out of the way: I'm embarrassed to let people look at this code. My main excuse for the state it's in is that building up tech debt is a good idea for indies who don't know how long they're going to stick with a project, because it's a debt you probably never have to pay back. For me, the *most* embarrassing part are the Hero and Monster classes themselves; there is a lot of duplicate code in there. :scream:

The second most embarrassing part is that I switched to typescript partway through, learning typescript as I went, and the project is part lua, part n00b typescript.

Another embarrassment is that I started with Google Analytics, decided it didn't do what I wanted and tried Game Analytics, decided I didn't like that either and rolled my own, but left Google in for error tracking and GA in just to watch overall engagement.

That said, there's more here I'm proud of than embarrassed of--for the most part it is data driven, and it doesn't do stateful things when not necessary, and those are usually my two priorities when architecting--so if you see something you don't like chances are I did it that way for a reason. Feel free to ask why!

And this is the first time I've released open soure in this manner - if there are common practices it would be nice for me to do let me know!

# building

Anyways, here's how to build for the first time. Most of these instructions are adapted from (https://roblox-ts.github.io/docs/guides/github-installation)

Open the rbxl/DungeonLifeOpenTemplate.rbxl in Roblox and publish it. Go to Game Settings and enable Studio API Access.

Give me credit! Configure your place and in your description put: "Made with Dungeon Life by Jamie Fristrom: https://www.roblox.com/games/2184151436"

The place won't do anything by itself; you still need to build the source and suck it in with Rojo. How to use Rojo is beyond the scope of this article. (https://github.com/rojo-rbx/rojo)

I made my own clone of roblox-ts and used a submodule partly for the practice with submodules and partly as a way to make my own local fixes.

>git submodule update --init --recursive
Overkill but that should get the roblox-ts branch to where I like

>npm install
>cd roblox-ts
>npm install typescript@3.3.4000
The version of roblox-ts I'm using doesn't compile with the latest typescript

>npm install
Gets the packages roblox-ts relies on

>npm link
I'm not entirely clear on what this step does. But now you can compile dungeon life

>tsc
(Might need to do npm link again here? Not sure.)

Compiles roblox-ts

>cd ..
>rbxtsc
Then you should be able to use Rojo to transfer the source to the Place you've built, and it should work.

If you have problems let me know but I can't promise speedy answers!

# it's not you it's me

Some current known problems: no custom animations are working, the localization is missing, and some of the images are missing (the minimap tiles in particular are a game-breaker.) The in-app purchases are still wired to the original Game; you'll have to create your own in-app purchases and change the id's in order to let people buy things in yours.

If you spot other problems, it's probably because there are other issues running the code in a standalone place. You can check my test place https://www.roblox.com/games/4476008779: if the bug happens there too, it's not you, it's me. :)


156 changes: 156 additions & 0 deletions default.project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
{
"name": "roblox-ts-game",
"tree": {
"$className": "DataModel",
"ServerScriptService": {
"$className": "ServerScriptService",
"Lua": {
"$path": "out/ServerScriptService/Lua"
},
"TS": {
"$path": "out/ServerScriptService/TS"
}
},
"ReplicatedStorage": {
"$className": "ReplicatedStorage",
"rbxts_include": {
"$path": "include"
},
"TS": {
"$path": "out/ReplicatedStorage/TS"
},
"Standard": {
"$path": "out/ReplicatedStorage/Standard"
}
},
"StarterPlayer": {
"$className": "StarterPlayer",
"StarterPlayerScripts": {
"$className": "StarterPlayerScripts",
"Lua": {
"$path": "out/StarterPlayer/StarterPlayerScripts/Lua"
},
"TS": {
"$path": "out/StarterPlayer/StarterPlayerScripts/TS"
}
}
},
"ReplicatedFirst": {
"$className": "ReplicatedFirst",
"TS": {
"$path": "out/ReplicatedFirst/TS"
}
},
"ServerStorage": {
"$className": "ServerStorage",
"Standard": {
"$path": "out/ServerStorage/Standard"
},
"TS": {
"$path": "out/ServerStorage/TS"
}
},
"StarterGui": {
"$className": "StarterGui",
"AwardGui": {
"$className": "ScreenGui",
"Lua": {
"$path": "out/StarterGui/AwardGui/Lua"
}
},
"CharacterSheetGui": {
"$className": "ScreenGui",
"Lua": {
"$path": "out/StarterGui/CharacterSheetGui/Lua"
}
},
"NoResetGui": {
"$className": "ScreenGui",
"Lua": {
"$path": "out/StarterGui/NoResetGui/Lua"
},
"TS": {
"$path": "out/StarterGui/NoResetGui/TS"
},
"FeedbackPanel": {
"$className": "Frame",
"TS": {
"$path": "out/StarterGui/NoResetGui/FeedbackPanel/TS"
}
}
},
"FurnishGui": {
"$className": "ScreenGui",
"Lua": {
"$path": "out/StarterGui/FurnishGui/Lua"
}
},
"HeroGui": {
"$className": "ScreenGui",
"Lua": {
"$path": "out/StarterGui/HeroGui/Lua"
},
"TS": {
"$path": "out/StarterGui/HeroGui/TS"
}
},
"MapGui": {
"$className": "ScreenGui",
"Lua": {
"$path": "out/StarterGui/MapGui/Lua"
}
},
"MessageGuiConfiguration": {
"$className": "ScreenGui",
"Lua": {
"$path": "out/StarterGui/MessageGuiConfiguration/Lua"
},
"StarFeedbackFrameTemplate": {
"$className": "Frame",
"TS": {
"$path": "out/StarterGui/MessageGuiConfiguration/StarFeedbackFrameTemplate/TS"
}
}
},
"PlayerListGui": {
"$className": "ScreenGui",
"Lua": {
"$path": "out/StarterGui/PlayerListGui/Lua"
}
},
"PossessionsGui": {
"$className": "ScreenGui",
"Lua": {
"$path": "out/StarterGui/PossessionsGui/Lua"
},
"TS": {
"$path": "out/StarterGui/PossessionsGui/TS"
}
},
"StoreGui": {
"$className": "ScreenGui",
"Lua": {
"$path": "out/StarterGui/StoreGui/Lua"
},
"TS": {
"$path": "out/StarterGui/StoreGui/TS"
}
},
"TopGui": {
"$className": "ScreenGui",
"Lua": {
"$path": "out/StarterGui/TopGui/Lua"
}
},
"HUDGui": {
"$className": "ScreenGui",
"TS": {
"$path": "out/StarterGui/HUDGui/TS"
},
"Lua": {
"$path": "out/StarterGui/HUDGui/Lua"
}
}
}
}
}
Loading

0 comments on commit 45ab653

Please sign in to comment.