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

View File

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

View File

@ -112,7 +112,7 @@ export class Ship {
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()));
window.setTimeout(() => {
@ -201,10 +201,12 @@ export class Ship {
shipMesh.rotation.y = Math.PI;
shipMesh.position.y = 1;
shipMesh.position.z = -1;
shipMesh.renderingGroupId = 3;
const light = new PointLight("ship.light", new Vector3(0, 1, .9), DefaultScene.MainScene);
light.intensity = 4;
light.includedOnlyMeshes = [shipMesh];
for (const mesh of shipMesh.getChildMeshes()) {
mesh.renderingGroupId = 3;
if (mesh.material.id.indexOf('glass') === -1) {
light.includedOnlyMeshes.push(mesh);
}

View File

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