Skip to content

Commit

Permalink
polish
Browse files Browse the repository at this point in the history
  • Loading branch information
nearnshaw committed Dec 29, 2023
1 parent b7b5505 commit 82114f3
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 38 deletions.
52 changes: 31 additions & 21 deletions bin/game.js

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions src/definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ export type TapDataType = {
name: string
}

export enum TileType {
Floor,
Shelf,
Expender,
Trash,
Pot,
Cutter,
Plate,
}
// export enum TileType {
// Floor,
// Shelf,
// Expender,
// Trash,
// Pot,
// Cutter,
// Plate,
// }

export enum SoupState {
Empty,
Expand Down
10 changes: 8 additions & 2 deletions src/modules/customers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ const customerBeerMessages = [
'Beer! A nice cold one!',
]

const customerLookingMessage = [
'Im just here to watch',
'I dont want anything. Just here to make you feel uncomfortable.',
'Making a documentary, keep working as if Im not here',
]



const customerCorrectDishMessages = [
'Excellent!',
Expand Down Expand Up @@ -138,7 +145,6 @@ export function CreateCustomer() {

const randomTime = Scalar.randomRange(3, 6)


const progressBar = CreateProgressBar(customer, 1.3, 180, false, 0.1)

const dish = Math.floor(Scalar.randomRange(0, Object.keys(IngredientType).length))
Expand All @@ -164,7 +170,7 @@ export function CreateCustomer() {
messages = customerBeerMessages
break
default:
messages = customerCookedNoodleMessages
messages = customerLookingMessage
break
}

Expand Down
2 changes: 1 addition & 1 deletion src/modules/cuttingBoard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export function cutSushi(entity: Entity, modelEntity: Entity) {

utils.timers.setTimeout(() => {
boardData.cutting = false
}, 1000)
}, 500)

}

Expand Down
7 changes: 4 additions & 3 deletions src/modules/pickAndDrop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,8 @@ export function pickingGlassSystem() {

// If there is a tap base (the collider)
if (hitParentEntity && TapBase.getOrNull(hitParentEntity)) {
// Transform.createOrReplace(pickedUp.child, {
// parent: hitParentEntity
// })
Transform.getMutable(pickedUpChild).rotation = Quaternion.Zero()
Transform.getMutable(pickedUpChild).position = Vector3.Zero()
console.log("DROPPED ON TAP")
//removeParent(pickedUpChild)
parentEntity(pickedUpChild, hitParentEntity)
Expand All @@ -51,6 +50,8 @@ export function pickingGlassSystem() {
//removeParent(pickedUpChild)
parentEntity(pickedUpChild, hitParentEntity)
drop = true
Transform.getMutable(pickedUpChild).rotation = Quaternion.Zero()
Transform.getMutable(pickedUpChild).position = Vector3.Zero()

board.hasRoll = true
board.rollChild = pickedUpChild
Expand Down
7 changes: 5 additions & 2 deletions src/modules/tap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@ import { Scalar } from '@dcl/sdk/math'
import { BeerGlass, BeerType, getTapData, TapBase, TapComponent } from '../definitions'
import { playSound } from './factory'
import { getPlayerPosition } from './helpers'
import { getParent } from '@dcl/sdk/network'

function getBeerBehindTap(beerType: BeerType) {
for (const [glassEntity, _1, _2, glassTransform] of engine.getEntitiesWith(BeerGlass, Animator, Transform)) {
if (glassTransform.parent && TapBase.getOrNull(glassTransform.parent)?.beerType === beerType) {
for (const [glassEntity] of engine.getEntitiesWith(BeerGlass)) {

const glassParent = getParent(glassEntity)
if (glassParent && TapBase.getOrNull(glassParent)?.beerType === beerType) {
return glassEntity
}
}
Expand Down

0 comments on commit 82114f3

Please sign in to comment.