swing adjustment. :)

This commit is contained in:
lustlion 2022-02-14 15:56:14 +01:00
parent acfc51ae03
commit f6541068e0
3 changed files with 33 additions and 89 deletions

View File

@ -113,10 +113,11 @@ function Player:Smart()
if self.dashCooldownTimer == 0 if self.dashCooldownTimer == 0
and not self.isDashing and not self.isDashing
and self.dashCount > 0 then and self.dashCount > 0 then
self:Unhook()
-- state player -- state player
self.dashCount = self.dashCount - 1
self.isDashing = true self.isDashing = true
self.dashCount = self.dashCount - 1
-- get dash direction -- get dash direction
local vertical = 0 local vertical = 0
@ -142,7 +143,7 @@ function Player:Smart()
if Keybind:CheckPressed(Keybind.move.hook) then if Keybind:CheckPressed(Keybind.move.hook) then
if self.isHooked then if self.isHooked then
self.isHooked = false self:Unhook()
else else
local anchor = self:CheckNearest("decoration",self.hookDistance) local anchor = self:CheckNearest("decoration",self.hookDistance)
if anchor then if anchor then
@ -207,6 +208,8 @@ function Player:DoPhysics()
} }
Particle:New(self.pos.x,self.pos.y,particle_data) Particle:New(self.pos.x,self.pos.y,particle_data)
local hook_angle = GetAngleFromVector(hook[1],hook[2])-math.rad(180) local hook_angle = GetAngleFromVector(hook[1],hook[2])-math.rad(180)
if Keybind:CheckDown(Keybind.move.right) then hook_angle = hook_angle - math.rad(0.05) end
if Keybind:CheckDown(Keybind.move.left) then hook_angle = hook_angle + math.rad(0.05) end
local pos_x = self.hookAnchor.x + self.hookedDistance * math.cos(hook_angle) local pos_x = self.hookAnchor.x + self.hookedDistance * math.cos(hook_angle)
local pos_y = self.hookAnchor.y + self.hookedDistance * math.sin(hook_angle) local pos_y = self.hookAnchor.y + self.hookedDistance * math.sin(hook_angle)
self.vel.x = self.vel.x + pos_x - self.pos.x self.vel.x = self.vel.x + pos_x - self.pos.x
@ -292,3 +295,8 @@ function Player:HandleAnimation()
end end
self.move_x = 0 self.move_x = 0
end end
function Player:Unhook()
self.isHooked = false
self.hookAnchor = nil
end

View File

@ -3,9 +3,13 @@ return {
tileset = tileset.library, tileset = tileset.library,
properties = { properties = {
darkness = false darkness = false
}, },
tiles = { tiles = {
{ 1, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 1}, { 1, 4, 0, 0, 0, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{ 1, 4, 0, 0, 0, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{ 1, 4, 0, 0, 0, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{ 1, 4, 0, 0, 0, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{ 1, 4, 0, 0, 0, 2, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 1},
{ 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1}, { 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1},
{ 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1}, { 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1},
{ 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1}, { 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1},

View File

@ -1,68 +0,0 @@
(*) Ideas
( ) DO FLIES
( ) DO UI
( ) DO DAMAGE TO PLAYER
( ) Visual design
(~) Multicolor palette depending on area, with 3 main colors
(X) Library: Gold #fed100
( )
( ) Dialog
( ) Fonts
( ) Characters
( ) Level design
( ) Enemy design
( ) Gameplay design
( ) Level design
( ) Mechanic design
( ) Entity design
(~) FAIRY
(X) basic movement
(X) Fairy particles~~
( ) more intelligent movement
( ) avoid getting stuck to walls
( ) Playtest tools
( ) Technical design
(?) Input
(X) ADDED KEYBINDS
( )
(?) Draw
(X) REHANDLE ANIMATIONS
(X) MAKE LIGHTING SYSTEM
(X) Pixel perfect entity drawing
( ) Pixel perfect lights
(?) Player
(X) MASKS FUNCTIONALITY
( )
(?) Physics
(X) MAKE PHYSICS CONSISTENT
(X) MAKE HITBOXES
(X) PHYSICS BY FRAME
(X) DEACTIVATE ARROWS WHEN STUCK
( )
(~) Dialog
(X) Object and Basics
( ) Fix font and align problems
( ) Implement portrait
(X) Translating framework
( ) Debug tools
( ) Audio and BGM
(~) REMAKE LEVEL EDITOR
(~) ADD WAY TO EDIT A LEVEL (EDITOR MODE)
(X) SHOW PALETTE
(X) PICK UP TILE FROM PALETTE
(X) PLACE PICKED UP TILE
( ) WAY TO INSERT ENTITIES IN THE LEVEL
(X) ADD WAY TO SAVE A LEVEL
( ) Narrative design
( ) Dialog
( ) Characters
( ) Area design
( ) Translations
( ) SPA "es_ES"
( ) ENG "en_UK"
( ) CAT "ca_ES"
( ) HEON "Myrheonian"