fix swing
This commit is contained in:
		
							parent
							
								
									8ddf3610ac
								
							
						
					
					
						commit
						6566e6fbab
					
				| 
						 | 
					@ -30,7 +30,7 @@
 | 
				
			||||||
  o.dashAmount = 10 -- int
 | 
					  o.dashAmount = 10 -- int
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  -- hook values
 | 
					  -- hook values
 | 
				
			||||||
  o.hookDistance = 100
 | 
					  o.hookDistance = 80
 | 
				
			||||||
  o.hookedDistance = 80
 | 
					  o.hookedDistance = 80
 | 
				
			||||||
  o.hookAnchor = {
 | 
					  o.hookAnchor = {
 | 
				
			||||||
    x = nil,
 | 
					    x = nil,
 | 
				
			||||||
| 
						 | 
					@ -199,6 +199,8 @@ function Player:DoPhysics()
 | 
				
			||||||
      local pos_y = self.hookAnchor.y + self.hookedDistance * math.sin(-math.rad(180)+hook_angle)
 | 
					      local pos_y = self.hookAnchor.y + self.hookedDistance * math.sin(-math.rad(180)+hook_angle)
 | 
				
			||||||
      self.vel.x = self.vel.x + pos_x - self.pos.x
 | 
					      self.vel.x = self.vel.x + pos_x - self.pos.x
 | 
				
			||||||
      self.vel.y = self.vel.y + pos_y - self.pos.y
 | 
					      self.vel.y = self.vel.y + pos_y - self.pos.y
 | 
				
			||||||
 | 
					      self.pos.x = pos_x
 | 
				
			||||||
 | 
					      self.pos.y = pos_y
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue