Merge pull request #3 from Panquesito7/various_improvements

Various changes and improvements
This commit is contained in:
squiddible 2020-06-28 17:17:00 -04:00 committed by GitHub
commit d9b45ed84e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 51 additions and 5 deletions

11
.github/workflows/build.yml vendored Normal file
View File

@ -0,0 +1,11 @@
on: [push, pull_request]
name: build
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: lint
uses: Roang-zero1/factorio-mod-luacheck@master
with:
luacheckrc_url: ""

14
.luacheckrc Normal file
View File

@ -0,0 +1,14 @@
unused_args = false
allow_defined_top = true
max_line_length = 999
globals = {
"minetest",
}
read_globals = {
string = {fields = {"split", "trim"}},
table = {fields = {"copy", "getn"}},
"abs",
}

View File

View File

@ -1,5 +1,23 @@
# real_g
# Real Gravity [![](https://github.com/minetest-mods/real_g/workflows/build/badge.svg)](https://github.com/minetest-mods/real_g/actions) [![License](https://img.shields.io/badge/license-MIT-purple.svg)](https://mit-license.org/)
Minetest mod that creates an imatation of real-world gravity. The farther away you get from sea level, the lower your gravity, and the closer you get to the sea, the higher your gravity.
*NOTE:* ***The mod should work for most versions of minetest.***
## Dependencies
- `default` (included in [Minetest Game](https://github.com/minetest/minetest_game)).
## Installation
- Unzip the archive, rename the folder to `real_g` and
place it in .. minetest/mods/
- GNU/Linux: If you use a system-wide installation place
it in ~/.minetest/mods/.
- If you only want this to be used in a single world, place
the folder in .. worldmods/ in your world directory.
For further information or help, see:\
https://wiki.minetest.net/Installing_Mods
## Requirements
- Recommended: MT 5.0.0+
- Minimum: MT 0.4.16+

View File

@ -1,8 +1,13 @@
--[[
Copyright (C) 2020 squiddible and contributors
This project is licensed under the MIT license.
See https://mit-license.org/ for more information.
--------------------------------------------------
Lowers gravity the higher (and lower) you get above (or below) sea
level, max gravity at sea level.
]]--
local action_timer = 0
@ -17,7 +22,6 @@ local gravity_update = function()
end
end
local function gravity_globaltimer(dtime)
action_timer = action_timer + dtime
@ -28,4 +32,3 @@ local function gravity_globaltimer(dtime)
end
minetest.register_globalstep(gravity_globaltimer)