2
0
bjorn 8 жил өмнө
parent
commit
bbb4aad11e
2 өөрчлөгдсөн 2 нэмэгдсэн , 5 устгасан
  1. 2 1
      client.lua
  2. 0 4
      server.lua

+ 2 - 1
client.lua

@@ -104,6 +104,7 @@ function client:update(dt)
 			self.duelTimer = math.max(self.duelTimer - dt, 0)
 			self.duelTimer = math.max(self.duelTimer - dt, 0)
 			local tx, ty, tz, angle, slotX, slotY, slotZ = self:getDuelZones()
 			local tx, ty, tz, angle, slotX, slotY, slotZ = self:getDuelZones()
 			local x, y, z = self.controllers[2]:getPosition()
 			local x, y, z = self.controllers[2]:getPosition()
+			print(tx, ty, tz, x, y, z, math.sqrt((slotX - x) ^ 2 + (slotY - y) ^ 2 + (slotZ - z) ^ 2), .1)
 			if math.sqrt((slotX - x) ^ 2 + (slotY - y) ^ 2 + (slotZ - z) ^ 2) < .1 then
 			if math.sqrt((slotX - x) ^ 2 + (slotY - y) ^ 2 + (slotZ - z) ^ 2) < .1 then
 				if not self.duelHover then
 				if not self.duelHover then
 					self.duelHover = true
 					self.duelHover = true
@@ -516,7 +517,7 @@ function client:getDuelZones()
 	local tx, ty, tz = (hx + ox) / 2, tableHeight, (hz + oz) / 2
 	local tx, ty, tz = (hx + ox) / 2, tableHeight, (hz + oz) / 2
 	local angle = -math.atan2((hz - oz), (hx - ox))
 	local angle = -math.atan2((hz - oz), (hx - ox))
 	local mySlotX, mySlotY, mySlotZ = tx + math.cos(-angle) * tableLength / 2 * .8, tableHeight + .2, tz + math.sin(-angle) * tableLength / 2 * .8
 	local mySlotX, mySlotY, mySlotZ = tx + math.cos(-angle) * tableLength / 2 * .8, tableHeight + .2, tz + math.sin(-angle) * tableLength / 2 * .8
-	local theirSlotX, theirSlotY, theirSlotZ = tx - math.cos(-angle) * tableLength / 2 * .8, tableHeight + .2, tz - math.sin(-angle) * tableLength / 2 * .8
+	local theirSlotX, theirSlotY, theirSlotZ = tx - math.cos(-angle) * tableLength * .6 / 2 * .8, tableHeight + .2, tz - math.sin(-angle) * tableLength * .6 / 2 * .8
 	return tx, ty, tz, angle, mySlotX, mySlotY, mySlotZ, theirSlotX, theirSlotY, theirSlotZ
 	return tx, ty, tz, angle, mySlotX, mySlotY, mySlotZ, theirSlotX, theirSlotY, theirSlotZ
 end
 end
 
 

+ 0 - 4
server.lua

@@ -72,10 +72,6 @@ function server:update(dt)
 				self.players[i].duelTimer = math.max(self.players[i].duelTimer - dt, 0)
 				self.players[i].duelTimer = math.max(self.players[i].duelTimer - dt, 0)
 				if self.players[i].duelTimer == 0 then
 				if self.players[i].duelTimer == 0 then
 					-- Timeout, send outcome message
 					-- Timeout, send outcome message
-					p1.dueling = 0
-					p2.dueling = 0
-					p1.duelChoice = 0
-					p2.duelChoice = 0
 				end
 				end
 			end
 			end
 		end
 		end