Skip to content

Commit

Permalink
- All screens are now Objects (fixes screen not being deleted during …
Browse files Browse the repository at this point in the history
…a reset)

- Integrated tutorial screen
- More generic way to go to next screen
  • Loading branch information
iarwain committed Jan 31, 2021
1 parent 0311922 commit 5e2c34f
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 78 deletions.
3 changes: 2 additions & 1 deletion data/config/select.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[Select]
[Select@Object]
ChildList = ModeTitle # PlayerSelection # InputText # SelectTable
NextScreen = Tutorial

[SelectTable@Table]
Scale = 0.65
Expand Down
8 changes: 4 additions & 4 deletions data/config/table.ini
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
8 changes: 6 additions & 2 deletions data/config/title.ini
Original file line number Diff line number Diff line change
@@ -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
Expand Down
136 changes: 69 additions & 67 deletions data/config/tutorial.ini
Original file line number Diff line number Diff line change
@@ -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
5 changes: 1 addition & 4 deletions src/Table.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ void Table::Update(const orxCLOCK_INFO &_rstInfo)
Deal();
PopConfigSection();
}

if(orxInput_HasBeenActivated("1P"))
{
orxConfig_SetParent("Scene", "1P");
Expand All @@ -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
Expand Down

0 comments on commit 5e2c34f

Please sign in to comment.