Skip to content

Commit

Permalink
Naming conventions for scenes
Browse files Browse the repository at this point in the history
  • Loading branch information
hubol committed Aug 13, 2024
1 parent 7cda451 commit 4dba2e4
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ Scenes can place Game Objects on one or more of the current "stages". Scenes may
They are somewhat of an analog to Game Maker's "Room" concept.

### Name
Use a function with a **PascalCase** name.
Use a function with a **camelCase** name prefixed **scn**.

### Organization
Place the module exporting the Scene in the **igua/scenes/** directory.
Place the module exporting the Scene in the **igua/scenes/** directory. The file should have a name prefixed **scn-**.


## Global Services
Expand Down
2 changes: 1 addition & 1 deletion src/igua/launch/start-game.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ import { SceneLibrary } from "../core/scene/scene-library";
import { sceneStack, startAnimator } from "../globals";

export function startGame() {
sceneStack.push(SceneLibrary.findByName('LevelTwo'), { useGameplay: false });
sceneStack.push(SceneLibrary.findByName('scnPotteryHouse'), { useGameplay: false });
startAnimator();
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { scene } from "../globals";
import { objUiIguanaDesignerRoot } from "../ui/iguana-designer/obj-ui-iguana-designer-root";
import { UiColor } from "../ui/ui-color";

export function IguanaDesigner() {
export function scnIguanaDesigner() {
scene.style.backgroundTint = UiColor.Shadow;
objUiIguanaDesignerRoot().show();
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { mxnRpgAttack } from "../mixins/mxn-rpg-attack";
import { RpgAttack } from "../rpg/rpg-attack";
import { RpgFaction } from "../rpg/rpg-faction";

export function PlayerTest() {
export function scnPlayerTest() {
Sprite.from(Tx.Placeholder).at(128, 128 - 14).mixin(mxnCutscene, async () => {
await show('Hello!');
}).show();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { playerObj } from "../objects/obj-player";
import { objValuableTrove } from "../objects/obj-valuable-trove";
import { RpgProgress } from "../rpg/rpg-progress";

export function LevelTwo() {
export function scnPotteryHouse() {
const level = Lvl.Potter();
scene.stage.step(() => {
if (Input.justWentDown('CastSpell'))
Expand Down
4 changes: 2 additions & 2 deletions src/igua/ui/iguana-designer/obj-ui-iguana-designer-root.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { UiColor, UiStyle } from "../ui-color";
import { createUiConnectedInputPageElements } from "./components/obj-ui-connected-input-page";
import { objUiDesignerNavigationButton } from "./components/obj-ui-designer-button";
import { objUiIguanaDesignerInspirationPage } from "./pages/obj-ui-iguana-designer-inspiration-page";
import { PlayerTest } from "../../scenes/player-test";
import { scnPlayerTest } from "../../scenes/scn-player-test";
import { RpgProgress } from "../../rpg/rpg-progress";
import { Environment } from "../../../lib/environment";
import { Toast } from "../../../lib/game-engine/toast";
Expand Down Expand Up @@ -183,7 +183,7 @@ function objUiSavePage() {
await layers.overlay.solid.fadeIn(500);
const looks = UiIguanaDesignerContext.value.looks;
RpgProgress.character.looks = looks;
sceneStack.replace(PlayerTest, { useGameplay: false });
sceneStack.replace(scnPlayerTest, { useGameplay: false });
page.destroy();
await layers.overlay.solid.fadeOut(500);
});
Expand Down

0 comments on commit 4dba2e4

Please sign in to comment.