Skip to content

FlippingFlips/pingod-addons-basicgame

Repository files navigation

PinGod-AddOns-BasicGame

C# .Net Godot Engine

This is a modification of the demo from pingod-addons. This is to demonstrate how to make basic game with more switches, modes from the initial addons repoistory as starter.

Quick Start

This requires the addons directory from pingod--addons to build and run.

  1. Load project with godot editor godot -e. Inside the Godot FileSytem browse to basicgame

  2. MainScene.tscn will be loaded on game launch

  3. Adding coins with key 5 and start with 1. You need to fill the ball trough, close game with ESC

  4. Use the Godot FileSystem and in the autoload directory open WindowActions.tscn. Turn on the switch window to show a switch UI when you launch the game again. Fill the trough and start a game. You can enable all the trough switches with one button, release a switch and drain balls to finish a game.

Noted Changes from the Demo-PinGod.tscn

Autoload Scene Overrrides

Autoload scene folder files can override the enabled addon plugins scene it uses.

Scene Changes
Machine.tscn Added more switches
Resources.tscn Added ball save scene to pre load
WindowActions.tscn To enable/disable switch window without touching addons scenes
PinGodGame.tscn Uses a custom PinGodGame.cs script named CustomPinGodGame.cs to demonstrate overriding methods, creating custom players.

Added Scenes


basicgame/MainScene.tscn (starting scene)

This is a copy of the MainScene from the addons. It reuses the script MainScene.cs with no changes as this just handles mostly adding the Game, Attract, Service scenes

In the godot scene inspector we added the path to our custom basicgame/Game.tscn in the scenes Game Scene Path. This will load our game scene instead of the default.


basicgame/Game.tscn Scene

This is a copy of the Game.tscn from the addons. This scene uses a custom class scripts/BasicGame.cs instead of the default Game.cs.

In the Modes CanvasLayer we have added the scenes/BasicMode.tscn scene.


BaseMode Scene

This mode handles displaying a BallSave scene when ball saved, handles the other switches to add points and the saucer to trigger a multiball.

A Saucer from the controls is added to this scene tree which starts the multiball.


Simulators

As in the pingod-addons demo it is loaded the same way.