diff --git a/README.txt b/README.txt index 7692c1f..7db59fd 100644 --- a/README.txt +++ b/README.txt @@ -1,5 +1,5 @@ -minipeli 0.2.4 by paramat. -A game for Minetest Engine 5.1.0 and later. +minipeli 0.2.5 by paramat. +A game for Minetest Engine 5.2.0 and later. See each mod for mod-specific credits and licenses. @@ -17,7 +17,7 @@ About Minipeli This game is intended to be an example of minimal requirements for a Minetest Engine game, while still supporting all non-Mapgen V6 mapgens and providing a minimal number of biomes with appropriate vertical variation. The intention is to help others and myself create completely new games. -This also suggests a good mod structure, as opposed to the problematic structure of the game called 'Minetest Game', which has most content in one large mod called 'default'. It is better to split content into many smaller mods. +This also suggests a good mod structure, as opposed to the problematic structure of Minetest Game, which has most content in one large mod. It is better to split content into many smaller mods. Because creating animated meshes is difficult, the player model from Minetest Game is used, it seems suitable for many games. The player API of Minetest Game is very useful and quite fundamental, so the 'player_api' mod from Minetest Game is included, but with new player textures. @@ -123,6 +123,7 @@ Minetest Game mods used heavily modified: 'default' mod: The minipeli 'gui', 'hand' and 'media' mods are derived from it. + 'gui' mod contains: Textures: gui_formbg diff --git a/mods/gui/README.txt b/mods/gui/README.txt index 5351d06..f487386 100644 --- a/mods/gui/README.txt +++ b/mods/gui/README.txt @@ -1,6 +1,5 @@ Minipeli mod: gui ================= -See license.txt for license information. Derived by paramat from Minetest Game 'default' mod. Authors of source code diff --git a/mods/gui/init.lua b/mods/gui/init.lua index 5195a78..0c544c3 100644 --- a/mods/gui/init.lua +++ b/mods/gui/init.lua @@ -6,8 +6,7 @@ minetest.register_on_joinplayer(function(player) listcolors[#00000069;#5A5A5A;#141318;#30434C;#FFF] ]] local name = player:get_player_name() local info = minetest.get_player_information(name) - -- 'info and' is a temporary workaround for an engine bug - if info and info.formspec_version > 1 then + if info.formspec_version > 1 then formspec = formspec .. "background9[5,5;1,1;gui_formbg.png;true;10]" else formspec = formspec .. "background[5,5;1,1;gui_formbg.png;true]" diff --git a/mods/hand/README.txt b/mods/hand/README.txt index cb60a6d..335c994 100644 --- a/mods/hand/README.txt +++ b/mods/hand/README.txt @@ -1,6 +1,5 @@ Minipeli mod: hand ================== -See license.txt for license information. Derived by paramat from Minetest Game 'default' mod. Authors of source code diff --git a/mods/hand/textures/wieldhand.png b/mods/hand/textures/wieldhand.png index e4ef954..322e0cb 100644 Binary files a/mods/hand/textures/wieldhand.png and b/mods/hand/textures/wieldhand.png differ diff --git a/mods/light/README.txt b/mods/light/README.txt index 553a77c..a5070f4 100644 --- a/mods/light/README.txt +++ b/mods/light/README.txt @@ -1,5 +1,5 @@ Minipeli mod: light =================== -See license.txt for license information. + Source code by paramat (MIT). Textures by paramat (CC BY-SA 3.0). diff --git a/mods/mapgen/README.txt b/mods/mapgen/README.txt index 1aa59d4..527844f 100644 --- a/mods/mapgen/README.txt +++ b/mods/mapgen/README.txt @@ -1,10 +1,13 @@ Minipeli mod: mapgen ==================== -See license.txt for license information. + Source code by paramat (MIT). + +Authors of media +---------------- All textures by paramat (CC BY-SA 3.0). -All sounds from Minetest Game: +All sounds from Minetest Game 'default' mod: Mito551 (sounds) (CC BY-SA 3.0): dig_cracky.ogg diff --git a/mods/media/README.txt b/mods/media/README.txt index 4141a97..1d20078 100644 --- a/mods/media/README.txt +++ b/mods/media/README.txt @@ -1,7 +1,5 @@ Minipeli mod: media =================== -See license.txt for license information. -Derived by paramat from Minetest Game 'default' mod. Authors of media ---------------- diff --git a/mods/player_api/README.txt b/mods/player_api/README.txt index 2b083b6..7e0063d 100644 --- a/mods/player_api/README.txt +++ b/mods/player_api/README.txt @@ -1,6 +1,5 @@ Minipeli mod: player_api ======================== -See license.txt for license information. Derived by paramat from Minetest Game 'player_api' mod. Provides an API to allow multiple mods to set player models and textures. diff --git a/mods/player_api/api.lua b/mods/player_api/api.lua index 0afd679..6f4689c 100644 --- a/mods/player_api/api.lua +++ b/mods/player_api/api.lua @@ -96,6 +96,15 @@ end) local player_set_animation = player_api.set_animation local player_attached = player_api.player_attached +-- Prevent knockback for attached players +local old_calculate_knockback = minetest.calculate_knockback +function minetest.calculate_knockback(player, ...) + if player_attached[player:get_player_name()] then + return 0 + end + return old_calculate_knockback(player, ...) +end + -- Check each player and apply animations minetest.register_globalstep(function(dtime) for _, player in pairs(minetest.get_connected_players()) do @@ -104,14 +113,8 @@ minetest.register_globalstep(function(dtime) local model = model_name and models[model_name] if model and not player_attached[name] then local controls = player:get_player_control() - local walking = false local animation_speed_mod = model.animation_speed or 30 - -- Determine if the player is walking - if controls.up or controls.down or controls.left or controls.right then - walking = true - end - -- Determine if the player is sneaking, and reduce animation speed if so if controls.sneak then animation_speed_mod = animation_speed_mod / 2 @@ -120,18 +123,19 @@ minetest.register_globalstep(function(dtime) -- Apply animations based on what the player is doing if player:get_hp() == 0 then player_set_animation(player, "lay") - elseif walking then + -- Determine if the player is walking + elseif controls.up or controls.down or controls.left or controls.right then if player_sneak[name] ~= controls.sneak then player_anim[name] = nil player_sneak[name] = controls.sneak end - if controls.LMB then + if controls.LMB or controls.RMB then player_set_animation(player, "walk_mine", animation_speed_mod) else player_set_animation(player, "walk", animation_speed_mod) end - elseif controls.LMB then - player_set_animation(player, "mine") + elseif controls.LMB or controls.RMB then + player_set_animation(player, "mine", animation_speed_mod) else player_set_animation(player, "stand", animation_speed_mod) end diff --git a/mods/player_api/models/character.png b/mods/player_api/models/character.png index b145d53..86b62f7 100644 Binary files a/mods/player_api/models/character.png and b/mods/player_api/models/character.png differ diff --git a/mods/player_api/textures/player.png b/mods/player_api/textures/player.png index 95b9515..bea0498 100644 Binary files a/mods/player_api/textures/player.png and b/mods/player_api/textures/player.png differ diff --git a/mods/player_api/textures/player_back.png b/mods/player_api/textures/player_back.png index 3c4f082..67f6fa6 100644 Binary files a/mods/player_api/textures/player_back.png and b/mods/player_api/textures/player_back.png differ