Tvick22 / platformer3x

Student repository for Trimester 3, Spring 2024. (Leaderboard Team)
https://tvick22.github.io/platformer3x/
Apache License 2.0
0 stars 0 forks source link

Merge for our new level to be integrated into our main #47

Closed AlexRubio1 closed 4 months ago

AlexRubio1 commented 4 months ago

Merge our code with the teams main code

Pull request broke

Our code ended up being broke as me and Travis's code wasn't up to date with the new code in there original platform 3x has been adapted to make the code shorter as less complicated which we were not prepared for.

    //Skibidi Toilet Level
    const skibidiGameObjects = [
      // GameObject(s), the order is important to z-index...
      { name: 'desert', id: 'background', class: Background, data: this.assets.backgrounds.desert },
      //{ name: 'clouds', id: 'background', class: BackgroundClouds, data: this.assets.backgrounds.clouds },
      { name: 'skibidiTitan', id: 'skibidiTitan', class: skibidiTitan, data: this.assets.enemies.skibidiTitan, xPercentage:  0.35, yPercentage: 0.5, minPosition: 0.5 }, 
      { name: 'sand', id: 'platform', class: Platform, data: this.assets.platforms.sand },
      { name: 'blocks', id: 'jumpPlatform', class: BlockPlatform, data: this.assets.platforms.sand, xPercentage: 0.2, yPercentage: 1 },
      { name: 'blocks', id: 'jumpPlatform', class: BlockPlatform, data: this.assets.platforms.sand, xPercentage: 0.4, yPercentage: 0.6 },
      { name: 'blocks', id: 'jumpPlatform', class: BlockPlatform, data: this.assets.platforms.sand, xPercentage: 0.325, yPercentage: 0.8 },
      { name: 'blocks', id: 'jumpPlatform', class: BlockPlatform, data: this.assets.platforms.sand, xPercentage: 0.2, yPercentage: 0.5 },
      { name: 'blocks', id: 'jumpPlatform', class: BlockPlatform, data: this.assets.platforms.sand, xPercentage: 0.225, yPercentage: 0.5 },
      { name: 'blocks', id: 'jumpPlatform', class: BlockPlatform, data: this.assets.platforms.sand, xPercentage: 0.0, yPercentage: 0.5 } ,
      { name: 'blocks', id: 'jumpPlatform', class: BlockPlatform, data: this.assets.platforms.sand, xPercentage: 0.025, yPercentage: 0.5 },
      { name: 'blocks', id: 'jumpPlatform', class: BlockPlatform, data: this.assets.platforms.sand, xPercentage: 0.025, yPercentage: 0.5 },
      { name: 'blocks', id: 'jumpPlatform', class: BlockPlatform, data: this.assets.platforms.sand, xPercentage: 0.5, yPercentage: 0.5 },
      ///{ name: 'coin', id: 'coin', class: Coin, data: this.assets.obstacles.vbucks, xPercentage: 0.475, yPercentage: 0.5 },
      { name: 'coin', id: 'coin', class: Coin, data: this.assets.obstacles.vbucks, xPercentage: 0.325, yPercentage: 0.7 },
      { name: 'coin', id: 'coin', class: Coin, data: this.assets.obstacles.vbucks, xPercentage: -0.0125, yPercentage: 0.4 },
      { name: 'coin', id: 'coin', class: Coin, data: this.assets.obstacles.vbucks, xPercentage: 0.0125, yPercentage: 0.4 },
      { name: 'coin', id: 'coin', class: Coin, data: this.assets.obstacles.vbucks, xPercentage: 0.0325, yPercentage: 0.4 },
      { name: 'SkibidiToilet', id: 'SkibidiToilet', class: SkibidiToilet, data: this.assets.enemies.skibidiToilet, xPercentage:  0.3, minPosition: 0.07 },
      { name: 'SkibidiToilet', id: 'SkibidiToilet', class: SkibidiToilet, data: this.assets.enemies.skibidiToilet, xPercentage:  0.5, minPosition: 0.3 },
      { name: 'SkibidiToilet', id: 'SkibidiToilet', class: SkibidiToilet, data: this.assets.enemies.skibidiToilet, xPercentage:  0.75, minPosition: 0.5 }, //this special name is used for random event 2 to make sure that only one of the Goombas ends the random event
      { name: 'escaper', id: 'player', class: PlayerSkibidi, data: this.assets.players.escaper  },
      { name: 'laser', id: 'Laser', class: Laser, data: this.assets.obstacles.laser, xPercentage:  0.75, yPercentage: 0.5 },
      { name: 'toiletTube', id: 'toiletEnd', class: Tree, data: this.assets.obstacles.toilet },
      { name: 'complete3', id: 'background', class: BackgroundTransitions,  data: this.assets.backgrounds.complete3 },
    ];

    new GameLevel( {tag: "skibidi", callback: this.playerOffScreenCallBack, objects: skibidiGameObjects} );

The code that I tried to integrate ended up being broken as there was no SkibidiSand causing our level to break when entered and to fix this I instead used regular sand which was changed to a new texture but could be changed while also fixing the level with everything being able to be playable

import skibidiTitan from './SkibidiTitan.js';
import Laser from './Laser.js';
import SkibidiToilet from './SkibidiToilet.js';
import PlayerSkibidi from './PlayerSkibidi.js';
import Tree from './Tree.js';

I changed a lot along the way to fix the code as it would move on including platforms, my sprites, enemies, and some places of the platforms in the sky. Doing this helped me use the code that was Brough into the game including shortened versions and a more simplified sprite animation timer, while travis also fixed the ratios of the Titan while adapting to the new code.

ToiletEnding.Js

When I adapted our code into our main I saw that the toilet boosted up in scale size as with the new glow around the object seemed to help with it. A new bug we would need to fix is possibly the ratios of the toilet and to lower the size down as linking the toilet to Tube.Js brought the code to size the toilet as 1/4. We would need to change the our ToiletEnding.Js to adapt to the Tube.Js as Tree.Js is coming mainly from Tube while we mainly use Tree.