Refine gameplay balance and rendering performance
All checks were successful
Build / build (push) Successful in 1m16s

Adjust difficulty parameters to improve game progression, optimize rendering with proper layer assignments, increase projectile velocity for better responsiveness, and clean up visual effects rendering.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Michael Mainguy 2025-10-28 16:58:13 -05:00
parent 5f3fcf6bc0
commit bb3aabcf3e
4 changed files with 26 additions and 19 deletions

View File

@ -73,25 +73,25 @@ export class Level1 implements Level {
case 'recruit': case 'recruit':
return { return {
rockCount: 5, rockCount: 5,
forceMultiplier: 1, forceMultiplier: .5,
rockSizeMin: 10, rockSizeMin: 10,
rockSizeMax: 20, rockSizeMax: 15,
distanceMin: 150, distanceMin: 80,
distanceMax: 200 distanceMax: 100
}; };
case 'pilot': case 'pilot':
return { return {
rockCount: 10, rockCount: 10,
forceMultiplier: 1.6, forceMultiplier: 1,
rockSizeMin: 3, rockSizeMin: 8,
rockSizeMax: 8, rockSizeMax: 12,
distanceMin: 120, distanceMin: 80,
distanceMax: 220 distanceMax: 150
}; };
case 'captain': case 'captain':
return { return {
rockCount: 20, rockCount: 20,
forceMultiplier: 2.0, forceMultiplier: 1.2,
rockSizeMin: 2, rockSizeMin: 2,
rockSizeMax: 7, rockSizeMax: 7,
distanceMin: 100, distanceMin: 100,
@ -100,7 +100,7 @@ export class Level1 implements Level {
case 'commander': case 'commander':
return { return {
rockCount: 50, rockCount: 50,
forceMultiplier: 2.5, forceMultiplier: 1.3,
rockSizeMin: 2, rockSizeMin: 2,
rockSizeMax: 8, rockSizeMax: 8,
distanceMin: 90, distanceMin: 90,

View File

@ -38,6 +38,7 @@ export class Scoreboard {
const parent = scene.getMeshById('RightUpperDisplay'); const parent = scene.getMeshById('RightUpperDisplay');
const scoreboard = MeshBuilder.CreatePlane("scoreboard", {width: 1, height: 1}, scene); const scoreboard = MeshBuilder.CreatePlane("scoreboard", {width: 1, height: 1}, scene);
scoreboard.renderingGroupId = 3;
const material = new StandardMaterial("scoreboard", scene); const material = new StandardMaterial("scoreboard", scene);
scoreboard.parent =parent; scoreboard.parent =parent;

View File

@ -112,7 +112,7 @@ export class Ship {
ammoAggregate.body.setMotionType(PhysicsMotionType.DYNAMIC); ammoAggregate.body.setMotionType(PhysicsMotionType.DYNAMIC);
ammoAggregate.body.setLinearVelocity(this._ship.forward.scale(10000)) ammoAggregate.body.setLinearVelocity(this._ship.forward.scale(100000))
//.add(this._ship.physicsBody.getLinearVelocity())); //.add(this._ship.physicsBody.getLinearVelocity()));
window.setTimeout(() => { window.setTimeout(() => {
@ -201,10 +201,12 @@ export class Ship {
shipMesh.rotation.y = Math.PI; shipMesh.rotation.y = Math.PI;
shipMesh.position.y = 1; shipMesh.position.y = 1;
shipMesh.position.z = -1; shipMesh.position.z = -1;
shipMesh.renderingGroupId = 3;
const light = new PointLight("ship.light", new Vector3(0, 1, .9), DefaultScene.MainScene); const light = new PointLight("ship.light", new Vector3(0, 1, .9), DefaultScene.MainScene);
light.intensity = 4; light.intensity = 4;
light.includedOnlyMeshes = [shipMesh]; light.includedOnlyMeshes = [shipMesh];
for (const mesh of shipMesh.getChildMeshes()) { for (const mesh of shipMesh.getChildMeshes()) {
mesh.renderingGroupId = 3;
if (mesh.material.id.indexOf('glass') === -1) { if (mesh.material.id.indexOf('glass') === -1) {
light.includedOnlyMeshes.push(mesh); light.includedOnlyMeshes.push(mesh);
} }

View File

@ -42,6 +42,9 @@ export class RockFactory {
console.log("Pre-creating explosion particle systems..."); console.log("Pre-creating explosion particle systems...");
for (let i = 0; i < this._poolSize; i++) { for (let i = 0; i < this._poolSize; i++) {
const set = await ParticleHelper.CreateAsync("explosion", DefaultScene.MainScene); const set = await ParticleHelper.CreateAsync("explosion", DefaultScene.MainScene);
set.systems.forEach((system) => {
system.renderingGroupId =1;
})
this._explosionPool.push(set); this._explosionPool.push(set);
} }
console.log(`Created ${this._poolSize} explosion particle systems in pool`); console.log(`Created ${this._poolSize} explosion particle systems in pool`);
@ -70,8 +73,8 @@ export class RockFactory {
//material.albedoColor = new Color3(1, 1, 1); //material.albedoColor = new Color3(1, 1, 1);
//material.emissiveColor = new Color3(1, 1, 1); //material.emissiveColor = new Color3(1, 1, 1);
this._rockMesh.material = this._rockMaterial; this._rockMesh.material = this._rockMaterial;
//importMesh.meshes[1].dispose(false, true); importMesh.meshes[1].dispose(false, true);
//importMesh.meshes[0].dispose(); importMesh.meshes[0].dispose();
} }
} }
} }
@ -114,7 +117,7 @@ export class RockFactory {
body.setLinearDamping(0); body.setLinearDamping(0);
body.setMotionType(PhysicsMotionType.DYNAMIC); body.setMotionType(PhysicsMotionType.DYNAMIC);
body.setCollisionCallbackEnabled(true); body.setCollisionCallbackEnabled(true);
let scaling = Vector3.One();
body.getCollisionObservable().add((eventData) => { body.getCollisionObservable().add((eventData) => {
if (eventData.type == 'COLLISION_STARTED') { if (eventData.type == 'COLLISION_STARTED') {
if ( eventData.collidedAgainst.transformNode.id == 'ammo') { if ( eventData.collidedAgainst.transformNode.id == 'ammo') {
@ -124,7 +127,8 @@ export class RockFactory {
eventData.collider.shape.dispose(); eventData.collider.shape.dispose();
eventData.collider.transformNode.dispose(); eventData.collider.transformNode.dispose();
eventData.collider.dispose(); eventData.collider.dispose();
scaling = eventData.collider.transformNode.scaling.clone();
console.log(scaling);
eventData.collidedAgainst.shape.dispose(); eventData.collidedAgainst.shape.dispose();
eventData.collidedAgainst.transformNode.dispose(); eventData.collidedAgainst.transformNode.dispose();
eventData.collidedAgainst.dispose(); eventData.collidedAgainst.dispose();
@ -137,7 +141,7 @@ export class RockFactory {
ParticleHelper.CreateAsync("explosion", DefaultScene.MainScene).then((set) => { ParticleHelper.CreateAsync("explosion", DefaultScene.MainScene).then((set) => {
const point = MeshBuilder.CreateSphere("point", {diameter: 0.1}, DefaultScene.MainScene); const point = MeshBuilder.CreateSphere("point", {diameter: 0.1}, DefaultScene.MainScene);
point.position = position.clone(); point.position = position.clone();
//point.isVisible = false; point.isVisible = false;
set.start(point); set.start(point);
@ -150,8 +154,8 @@ export class RockFactory {
// Use pooled explosion // Use pooled explosion
const point = MeshBuilder.CreateSphere("point", {diameter: 10}, DefaultScene.MainScene); const point = MeshBuilder.CreateSphere("point", {diameter: 10}, DefaultScene.MainScene);
point.position = position.clone(); point.position = position.clone();
//point.isVisible = false; point.isVisible = false;
point.scaling = scaling.multiplyByFloats(.2,.3,.2);
console.log("Using pooled explosion with", explosion.systems.length, "systems at", position); console.log("Using pooled explosion with", explosion.systems.length, "systems at", position);
// Set emitter and start each system individually // Set emitter and start each system individually