From 5e2c34f9c01df178890fe730a28172db3515baad Mon Sep 17 00:00:00 2001 From: iarwain Date: Sun, 31 Jan 2021 08:59:27 -0500 Subject: [PATCH] - All screens are now Objects (fixes screen not being deleted during a reset) - Integrated tutorial screen - More generic way to go to next screen --- data/config/select.ini | 3 +- data/config/table.ini | 8 +-- data/config/title.ini | 8 ++- data/config/tutorial.ini | 136 ++++++++++++++++++++------------------- src/Table.cpp | 5 +- 5 files changed, 82 insertions(+), 78 deletions(-) diff --git a/data/config/select.ini b/data/config/select.ini index 31bf423..20d48c5 100644 --- a/data/config/select.ini +++ b/data/config/select.ini @@ -1,5 +1,6 @@ -[Select] +[Select@Object] ChildList = ModeTitle # PlayerSelection # InputText # SelectTable +NextScreen = Tutorial [SelectTable@Table] Scale = 0.65 diff --git a/data/config/table.ini b/data/config/table.ini index bfa7f2b..67a4c18 100644 --- a/data/config/table.ini +++ b/data/config/table.ini @@ -1,13 +1,13 @@ -[1P] +[1P@Object] ChildList = Player1 # Table -[2P] +[2P@Object] ChildList = Player1 # Player2 # Table -[3P] +[3P@Object] ChildList = Player1 # Player2 # Player3 # Table -[4P] +[4P@Object] ChildList = Player1 # Player2 # Player3 # Player4 # Table [Scene@2P] diff --git a/data/config/title.ini b/data/config/title.ini index 136bd88..20e0592 100644 --- a/data/config/title.ini +++ b/data/config/title.ini @@ -1,10 +1,14 @@ -[Title] +[Title@Object] TrackList = PressStartTrack # SoundSettingsTrack ChildList = Name # Authors # Powered # PressStart # Preload # AttractTable +NextScreen = Select [PressStartTrack] Loop = true -0 = > Input.IsActive Start, EvalIf < "Object.Create Select, Object.Delete ^" +0 = > Input.IsActive Start, > Input.HasNewStatus Start, > and < <, EvalIf < "Object.AddTrack ^ NextScreenTrack" + +[NextScreenTrack] +0.01 = > Object.GetName ^, > Get < NextScreen, Object.Create <, Object.Delete ^ [SoundSettingsTrack] 0 = Sound.SetBusVolume sfx 0.3, Sound.SetBusVolume music 0.2, Object.Create Music diff --git a/data/config/tutorial.ini b/data/config/tutorial.ini index b14e573..764fa09 100644 --- a/data/config/tutorial.ini +++ b/data/config/tutorial.ini @@ -1,67 +1,69 @@ -[Tutorial] -ChildList = TutorialMatch # TutorialSwap # TutorialTitle # MatchText # SwapText # ControlsText - -[TutorialMatch] -ParentCamera = MainCamera -UseParentSpace = position -Position = (-.2, -.15) -Scale = 5 -Graphic = @ -Texture = tutorial_match.png -TextureOrigin = (0, 0) -TextureSize = (100, 100) - -[TutorialSwap] -ParentCamera = MainCamera -UseParentSpace = position -Position = (.2, -.15) -Scale = 5 -Graphic = @ -Texture = tutorial_swap.png -TextureOrigin = (0, 0) -TextureSize = (100, 100) - -[TutorialTitle] -ParentCamera = MainCamera -UseParentSpace = position -Pivot = top left -Position = (-.45, -.45) -Graphic = @ -Text = @ -String = TUTORIAL -Scale = 10 - -[MatchText] -ParentCamera = MainCamera -UseParentSpace = position -Pivot = top center -Position = (-.2, .1) -Graphic = @ -Text = @ -String = "FLIP TWO CARDS AND FIND A MATCH. -EARN POINTS BY FINDING MORE PAIRS." -Scale = 4 - -[SwapText] -ParentCamera = MainCamera -UseParentSpace = position -Pivot = top center -Position = (.2, .1) -Graphic = @ -Text = @ -String = "SWAP CARDS POSITIONS ON THE BOARD" -Scale = 4 - -[ControlsText] -ParentCamera = MainCamera -UseParentSpace = position -Pivot = bottom center -Position = (0, .4) -Graphic = @ -Text = @ -String = "CONTROLS: -LEFT HAND: LJOYSTICK, DPAD, WASD -RIGHT HAND: RJOYSTICK, ABXY, ARROWS -PICKUP CARDS: BUMPERS, SPACE -SHUFFLE CARDS: TRIGGERS, SHIFT" -Scale = 4 +[Tutorial@Object] +ChildList = TutorialMatch # TutorialSwap # TutorialTitle # MatchText # SwapText # ControlsText +NextScreen = Scene +TrackList = PressStartTrack + +[TutorialMatch] +ParentCamera = MainCamera +UseParentSpace = position +Position = (-.2, -.15) +Scale = 5 +Graphic = @ +Texture = tutorial_match.png +TextureOrigin = (0, 0) +TextureSize = (100, 100) + +[TutorialSwap] +ParentCamera = MainCamera +UseParentSpace = position +Position = (.2, -.15) +Scale = 5 +Graphic = @ +Texture = tutorial_swap.png +TextureOrigin = (0, 0) +TextureSize = (100, 100) + +[TutorialTitle] +ParentCamera = MainCamera +UseParentSpace = position +Pivot = top left +Position = (-.45, -.45) +Graphic = @ +Text = @ +String = TUTORIAL +Scale = 10 + +[MatchText] +ParentCamera = MainCamera +UseParentSpace = position +Pivot = top center +Position = (-.2, .1) +Graphic = @ +Text = @ +String = "FLIP TWO CARDS AND FIND A MATCH. +EARN POINTS BY FINDING MORE PAIRS." +Scale = 4 + +[SwapText] +ParentCamera = MainCamera +UseParentSpace = position +Pivot = top center +Position = (.2, .1) +Graphic = @ +Text = @ +String = "SWAP CARDS POSITIONS ON THE BOARD" +Scale = 4 + +[ControlsText] +ParentCamera = MainCamera +UseParentSpace = position +Pivot = bottom center +Position = (0, .4) +Graphic = @ +Text = @ +String = "CONTROLS: +LEFT HAND: LJOYSTICK, DPAD, WASD +RIGHT HAND: RJOYSTICK, ABXY, ARROWS +PICKUP CARDS: BUMPERS, SPACE +SHUFFLE CARDS: TRIGGERS, SHIFT" +Scale = 4 diff --git a/src/Table.cpp b/src/Table.cpp index f751ae8..b2cf8d8 100644 --- a/src/Table.cpp +++ b/src/Table.cpp @@ -88,7 +88,6 @@ void Table::Update(const orxCLOCK_INFO &_rstInfo) Deal(); PopConfigSection(); } - if(orxInput_HasBeenActivated("1P")) { orxConfig_SetParent("Scene", "1P"); @@ -105,11 +104,9 @@ void Table::Update(const orxCLOCK_INFO &_rstInfo) { orxConfig_SetParent("Scene", "4P"); } - if(orxInput_HasBeenActivated("Start")) { - orxObject_Delete(orxOBJECT(orxObject_GetOwner(GetOrxObject()))); - ggj2021::GetInstance().CreateObject("Scene"); + orxObject_AddTimeLineTrack(orxOBJECT(orxObject_GetOwner(GetOrxObject())), "PressStartTrack"); } } else