Skip to content

Latest commit

 

History

History
172 lines (138 loc) · 7.38 KB

index.md

File metadata and controls

172 lines (138 loc) · 7.38 KB
layout title description image
base
Platformer Game v3.0
Incorporate student lessons. Gameplay includes enemies, platforms, parallax backgrounds, settings with local storage, etc. This revision introduces Settings, Leaderboard and Multiplayer.
/images/platformer/backgrounds/home.png

Timer: 0
Coins: 0
Start Game
Restart
Settings
Leaderboard

Fun Fact #0

Mario is named after the frustrated landlord, Mario Segale, of the Nintendo of America building.

<script type="module"> // Imports to drive game import GameSetup from '{{site.baseurl}}/assets/js/platformer/GameSetup.js'; import GameControl from '{{site.baseurl}}/assets/js/platformer/GameControl.js'; import SettingsControl from '{{site.baseurl}}/assets/js/platformer/SettingsControl.js'; import GameEnv from '{{site.baseurl}}/assets/js/platformer/GameEnv.js'; import Leaderboard from '{{site.baseurl}}/assets/js/platformer/Leaderboard.js'; import startCutstory from '{{site.baseurl}}/assets/js/platformer/Cutstory.js';; import RandomEvent from '{{site.baseurl}}/assets/js/platformer/RandomEvent.js'; /* * ========================================== * ========== Game Setup ==================== * ========================================== * Game Setup prepares the Game Levels and Objects * 1.) There are one-to-many GameLevels in a Game * 2.) Each GameLevel has one-to-many GameObjects * ========================================== */ // Setup game data, the objects and levels GameSetup.initLevels("{{site.baseurl}}"); /* * ========================================== * ========== Game Control ================== * ========================================== * Game Control starts the game loop and activates game objects * 1.) GameControl cycles through GameLevels * 2.) Each GameLevel is on a looping timer, called within the game loop * 3.) The game loop allows the game player (user), to interact with the game objects * 4.) A timer (or score) tracks the time of user interaction within the game * ========================================== */ // Start the PRIMARY game loop GameControl.gameLoop(); /* * ========================================== * ========== Settings Control ============== * ========================================== * Settings Control provides the ability to select game level and change game settings * 1.) SettingsControl must be after GameControl, it depends on GameLevels * 2.) GameControl extends and implements LocalStorage to support the persistence of user data * 3.) Modifications can be made to User ID, GameSpeed, Gravity, and Invert(ing) screen color * ========================================== */ // Construct settings sidebar, MVC variable paradigm, and async events to trigger user interaction SettingsControl.initialize(); // Added by students, should be factored into GameControl or SettingsControl Leaderboard.initializeLeaderboard(); startCutstory(); RandomEvent(); /* * ========================================== * ========== Event / Listeners ============= * ========================================== * System Event listeners * 1.) Window resize and GameEnv.resize trigger system updates * 2.) Most event listeners remain near impacting functions * ========================================== */ // Game refresh is required when the height and width of the screen are impacted window.addEventListener('resize', GameEnv.resize); </script>