Skip to content

Commit

Permalink
Merge pull request #11 from wizguin/develop
Browse files Browse the repository at this point in the history
1.6.0-beta
  • Loading branch information
wizguin authored Oct 25, 2023
2 parents 806017e + 742449b commit 6deff57
Show file tree
Hide file tree
Showing 114 changed files with 14,679 additions and 2,685 deletions.
3 changes: 0 additions & 3 deletions .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,5 @@
"corejs": 3
}
]
],
"plugins": [
"@babel/plugin-proposal-class-properties"
]
}
12 changes: 12 additions & 0 deletions assets/styles/fonts.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@
src: url('../fonts/Asterisk.woff2');
}

@font-face {
font-family: 'Burbank Big Regular';
font-weight: bold;
src: url('../fonts/Burbank Big Regular Bold.woff2');
}

@font-face {
font-family: 'Burbank Small';
src: url('../fonts/Burbank Small Medium.woff2');
Expand All @@ -41,6 +47,12 @@
src: url('../fonts/CCComicrazy-Roman.woff2');
}

@font-face {
font-family: 'CCComiccrazy Bold';
font-weight: bold;
src: url('../fonts/CCComicrazy_Bold.woff2');
}

@font-face {
font-family: 'CCFaceFront';
src: url('../fonts/CCFaceFront.woff2');
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<script src="assets/scripts/lib/phaser-cachebuster.min.js"></script>

<!-- Ruffle -->
<script src="assets/scripts/lib/ruffle/ruffle.js"></script>
<script src="https://unpkg.com/@ruffle-rs/ruffle"></script>

<!-- Client bundle -->
<script src="assets/scripts/client/yukon.js"></script>
Expand Down
4,968 changes: 2,530 additions & 2,438 deletions package-lock.json

Large diffs are not rendered by default.

26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "yukon",
"version": "1.5.0-beta",
"version": "1.6.0-beta",
"scripts": {
"dev": "webpack serve",
"editor": "phasereditor2d-launcher -project . -max-number-files 5000",
Expand All @@ -18,21 +18,21 @@
},
"homepage": "https://github.com/wizguin/yukon#readme",
"devDependencies": {
"@babel/core": "^7.20.2",
"@babel/preset-env": "^7.20.2",
"babel-loader": "^8.3.0",
"@babel/core": "^7.23.2",
"@babel/preset-env": "^7.23.2",
"babel-loader": "^9.1.3",
"compression-webpack-plugin": "^10.0.0",
"core-js": "^3.26.0",
"howler": "^2.2.3",
"html-webpack-plugin": "^5.5.0",
"javascript-obfuscator": "^4.0.0",
"phasereditor2d-launcher": "^3.35.1",
"core-js": "^3.33.0",
"howler": "^2.2.4",
"html-webpack-plugin": "^5.5.3",
"javascript-obfuscator": "^4.1.0",
"phasereditor2d-launcher": "^3.63.0",
"phasereditor2d-ninepatch-plugin": "^1.2.0",
"socket.io-client": "^4.5.3",
"socket.io-client": "^4.7.2",
"source-map": "^0.7.4",
"webpack": "^5.74.0",
"webpack-cli": "^4.10.0",
"webpack-dev-server": "^4.11.1",
"webpack": "^5.89.0",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^4.15.1",
"webpack-obfuscator": "^3.5.1"
}
}
3 changes: 2 additions & 1 deletion src/data/fonts.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ const fonts = {
'Arial:n4,n7',
'Arial Narrow:n4,n7',
'Asterisk:n4',
'Burbank Big Regular:n7',
'Burbank Small:n4,n7',
'CCComiccrazy:n4',
'CCComiccrazy:n4,n7',
'CCFaceFront:n4,i7'
],
urls: [
Expand Down
3 changes: 3 additions & 0 deletions src/data/game.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ const game = {

width: 1520,
height: 960,
maxWidth: 1520,
maxHeight: 960,

transparent: true,
roundPixels: true,

Expand Down
14 changes: 14 additions & 0 deletions src/data/rooms.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ const rooms = {
x: 828,
y: 520
},
320: {
key: 'Dojo',
scene: require('@rooms/dojo/Dojo').default,
x: 400,
y: 680
},
321: {
key: 'DojoExt',
scene: require('@rooms/dojoext/DojoExt').default,
Expand Down Expand Up @@ -130,6 +136,14 @@ const rooms = {
scene: require('@rooms/cove/Cove').default,
x: 840,
y: 480
},
951: {
key: 'Sensei',
scene: require('@rooms/../games/sensei/Sensei').default
},
998: {
key: 'CardJitsu',
scene: require('@rooms/../games/card/CardJitsu').default
}
}

Expand Down
7 changes: 6 additions & 1 deletion src/data/widgets.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ const widgets = {
'IglooCatalog': require('@scenes/interface/catalogs/igloo/IglooCatalog'),

'FindFour': require('@scenes/games/four/FindFour'),
'Map': require('@scenes/interface/game/map/Map')
'Mancala': require('@scenes/games/mancala/Mancala'),
'Map': require('@scenes/interface/game/map/Map'),
'NinjaBelts': require('@scenes/interface/instructions/ninjabelts/NinjaBelts'),
'NinjaInstructions': require('@scenes/interface/instructions/ninjainstructions/NinjaInstructions'),
'NinjaProgress': require('@scenes/games/ninjaprogress/NinjaProgress'),
'Sensei': require('@scenes/games/sensei/widget/SenseiWidget')
}

export default widgets
6 changes: 4 additions & 2 deletions src/engine/interface/InterfaceController.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,10 @@ export default class InterfaceController extends BaseScene {
this.bringToTop('IglooEdit')
}

bringToTop(key) {
this.scene.bringToTop(key)
bringToTop(key = null) {
if (key) {
this.scene.bringToTop(key)
}

// Keeps InterfaceController scene always on top, for prompts
this.scene.bringToTop()
Expand Down
34 changes: 34 additions & 0 deletions src/engine/loaders/CardLoader.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import BaseLoader from './BaseLoader'


export default class CardLoader extends BaseLoader {

constructor(scene) {
super(scene)

this.baseURL = '/assets/media/games/card/icons/'
this.keyPrefix = 'card/icons/'
}

loadCard(card, callback) {
let key = this.getKey(card.id)

if (this.checkComplete('image', key, () => {
this.onFileComplete(key, card, callback)
})) {
return
}

this.image(key, `${card.id}.png`)
this.start()
}

onFileComplete(key, card, callback) {
if (!this.textureExists(key)) {
return
}

callback(key, card)
}

}
12 changes: 10 additions & 2 deletions src/engine/network/plugins/plugins/Item.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,14 @@ export default class Item extends Plugin {
}

addItem(args) {
const item = parseInt(args.item)

// If item already in inventory
if (this.client.inventory[args.slot].includes(args.item)) return
if (this.client.inventory[args.slot].includes(item)) return

// Update player data
this.client.coins = args.coins
this.client.inventory[args.slot].push(args.item)
this.client.inventory[args.slot].push(item)
this.client.inventory[args.slot].sort((a, b) => a - b)

// Update player card
Expand All @@ -38,6 +40,12 @@ export default class Item extends Plugin {
// Update catalog coins
this.interface.updateCatalogCoins(args.coins)

// Check no purchase popup
const data = this.crumbs.items[item]
if ('no_purchase_popup' in data && data.no_purchase_popup === 1) {
return
}

// Show prompt
let text = `${args.name}\nhas been added to your inventory.`
this.interface.prompt.showWindow(text, 'single')
Expand Down
5 changes: 5 additions & 0 deletions src/engine/network/plugins/plugins/MiniGame.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ export default class MiniGame extends Plugin {
}

gameOver(args) {
if (this.world.client.activeSeat) {
this.world.events.once('leftseat', () => this.gameOver(args))
return
}

// Difference in coins = coins earned
this.interface.prompt.showCoin(args.coins - this.world.client.coins)

Expand Down
8 changes: 6 additions & 2 deletions src/engine/network/plugins/plugins/Table.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ export default class Table extends Plugin {
'join_table': this.joinTable,
'update_table': this.updateTable
}

this.types = {
'four': 'FindFour',
'mancala': 'Mancala'
}
}

getTables(args) {
Expand All @@ -19,8 +24,7 @@ export default class Table extends Plugin {
joinTable(args) {
this.world.client.sendMoveToSeat(args.table, args.seat)

// Todo: load different tables
this.interface.loadWidget('FindFour', true)
this.interface.loadWidget(this.types[args.game], true)
}

updateTable(args) {
Expand Down
29 changes: 29 additions & 0 deletions src/engine/network/plugins/plugins/Waddle.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import Plugin from '../Plugin'


export default class Waddle extends Plugin {

constructor(network) {
super(network)
this.events = {
'get_waddles': this.getWaddles,
'join_waddle': this.joinWaddle,
'update_waddle': this.updateWaddle
}
}

getWaddles(args) {
this.world.room.setWaddles(args.waddles)
}

joinWaddle(args) {
this.interface.main.waddle.show(args.waddle, args.seat, args.game)
}

updateWaddle(args) {
if (this.world.room.isReady) {
this.interface.main.waddle.updateWaddle(args.waddle, args.seat, args.username)
}
}

}
4 changes: 4 additions & 0 deletions src/engine/world/WorldController.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ export default class WorldController extends BaseScene {
return buddy.online
}

isClientUsername(username) {
return username.toLowerCase() === this.client.penguin.username.toLowerCase()
}

getColor(id) {
return this.crumbs.colors[id - 1] || this.crumbs.colors[0]
}
Expand Down
18 changes: 14 additions & 4 deletions src/engine/world/penguin/ClientController.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,14 +271,23 @@ export default class ClientController {
this.network.send('join_table', { table: id })
}

sendMoveToSeat(table, seat) {
table = this.world.room.getTable(table)
sendMoveToSeat(id, seat, type = 'table') {
let container

switch (type) {
case 'table':
container = this.world.room.getTable(id)
break
case 'waddle':
container = this.world.room.getWaddle(id)
break
}

if (!table) {
if (!container) {
return
}

seat = table[`seat${seat}`]
seat = container[`seat${seat}`]

if (seat) {
this.activeSeat = seat
Expand All @@ -303,6 +312,7 @@ export default class ClientController {
}

this.activeSeat = null
this.world.events.emit('leftseat')
}

getSeatWorldPos(seat) {
Expand Down
8 changes: 5 additions & 3 deletions src/engine/world/room/RoomFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,15 @@ export default class RoomFactory {
}

createGame(args) {
let crumb = this.games[args.game]
let config = this.games[args.game]

if (crumb.flash) {
this.world.ruffle.bootGame(crumb)
if (config.flash) {
this.world.ruffle.bootGame(config)

return
}

return this.createRoom({ room: args.game })
}

}
8 changes: 8 additions & 0 deletions src/scenes/games/GameScene.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,15 @@ export default class GameScene extends BaseScene {
this._create()

this.setMusic()

this.interface.hideLoading()
this.interface.bringToTop()

this.world.client.activeSeat = null
}

preload() {
this._preload()
}

stop() {
Expand Down
Loading

0 comments on commit 6deff57

Please sign in to comment.