Skip to content

Commit

Permalink
add some poles to the 2nd floor
Browse files Browse the repository at this point in the history
  • Loading branch information
meszaros-lajos-gyorgy committed May 25, 2024
1 parent e378a8e commit 6fd4f16
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 12 deletions.
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"homepage": "https://github.com/meszaros-lajos-gyorgy/arx-map-lalees-minigame#readme",
"dependencies": {
"arx-convert": "^9.0.0",
"arx-level-generator": "^18.0.1",
"arx-level-generator": "^18.1.0",
"three": "^0.158.0"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ map.config.offset = new Vector3(6000, 0, 6000)
map.player.position.adjustToPlayerHeight().add(new Vector3(1300, 0, -900))
map.player.orientation.y += MathUtils.degToRad(13)
map.player.withScript()
map.player.script?.properties.push(new Speed(1.3))
map.player.script?.properties.push(new Speed(3.3)) // 1.3
map.hud.hide('all')
map.hud.show(HudElements.Manabar)
map.hud.show(HudElements.BookIcon)
Expand Down
36 changes: 33 additions & 3 deletions src/rooms/secondFloor.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ArxPolygonFlags } from 'arx-convert/types'
import { Entity, Material, Settings, Texture, TextureOrMaterial, Vector3 } from 'arx-level-generator'
import { createPlaneMesh } from 'arx-level-generator/prefabs/mesh'
import { createPlaneMesh, createBox } from 'arx-level-generator/prefabs/mesh'
import { MathUtils, Vector2 } from 'three'
import { RoomContents } from '@/types.js'

Expand Down Expand Up @@ -36,6 +36,16 @@ const createPlaneAt = ({
return plane
}

const createPoleAt = ({ position }: { position: Vector3 }) => {
const box = createBox({
position: position.clone().add(new Vector3(0, -70, 0)),
materials: Texture.stoneHumanPriest4,
size: new Vector3(10, 140, 10),
})

return box
}

export const createSecondFloor = async (settings: Settings, gameStateManager: Entity): Promise<RoomContents> => {
const roomOrigin = new Vector3(-2450, -400, 0)

Expand Down Expand Up @@ -89,10 +99,30 @@ export const createSecondFloor = async (settings: Settings, gameStateManager: En
angleY: 90,
})

// TODO: add corner poles to support glass railing
// -----------------------------

const pole1 = createPoleAt({ position: roomOrigin.clone().add(new Vector3(-300, 0, -300)) })
const pole2 = createPoleAt({ position: roomOrigin.clone().add(new Vector3(300, 0, -300)) })
const pole3 = createPoleAt({ position: roomOrigin.clone().add(new Vector3(-300, 0, 300)) })
const pole4 = createPoleAt({ position: roomOrigin.clone().add(new Vector3(300, 0, 300)) })

// -----------------------------

return {
meshes: [railing1, railing2, railing3, railing4, blocker1, blocker2, blocker3, blocker4],
meshes: [
railing1,
railing2,
railing3,
railing4,
blocker1,
blocker2,
blocker3,
blocker4,
pole1,
pole2,
pole3,
pole4,
],
entities: [],
lights: [],
zones: [],
Expand Down

0 comments on commit 6fd4f16

Please sign in to comment.