Skip to content

Commit

Permalink
Merge pull request #17 from Crazy-Cow/CD-65
Browse files Browse the repository at this point in the history
Fix: y axis shooting
  • Loading branch information
seven05 authored Nov 14, 2024
2 parents d651e21 + 6d7befd commit 3aea6e1
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/app_cannon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const TAIL_STEAL_DISTANCE = 5
const MAX_SPEED = 10
// 캐릭터 위치 생성 함수
const generateRandomPosition = (): Position => {
return { x: Math.random() * 10, y: 2, z: Math.random() * 10 }
return { x: Math.random() * 10, y: 1, z: Math.random() * 10 }
}

const generateRandomHexColor = (): string => {
Expand Down Expand Up @@ -123,11 +123,7 @@ io.on('connection', (socket: Socket) => {
const newPosition = generateRandomPosition()
const characterBody = new CANNON.Body({
mass: 1, // 질량 설정
position: new CANNON.Vec3(
newPosition[0],
newPosition[1],
newPosition[2]
),
position: new CANNON.Vec3(newPosition.x, newPosition.y, newPosition.z),
material: characterMaterial,
})
const shape = new CANNON.Sphere(CHARACTER_SIZE / 2)
Expand Down Expand Up @@ -254,7 +250,7 @@ setInterval(() => {

characters.forEach((character) => {
character.isBeingStolen = false
// console.log(character.id, character.position)
console.log(character.id, character.position)
})

characters.forEach((character) => {
Expand Down

0 comments on commit 3aea6e1

Please sign in to comment.