Skip to content

Veupix/godot-gpt.gdscript

Repository files navigation

godot-gpt.gdscript

Game-project template for Godot game engine (GDScript)

But Why?:

Just so as not to waste time creating standard parts and structure from the beginning (like an Opening, Main menu, Game menu, Ending, etc.).

Requirements:

Only Godot engine.
tested on Godot 3.0 (stable) and Godot 3.1 (alpha)

Template is Separated to:

  • Global (scripts for AutoLoading, shared controls, assets (fonts, textures, audio/video), etc.)
  • Opening (opening scene of the company/creator(s) presentation with own set of assets, commercial ad and etc.; can be closed via event ui_skip_titles)
  • Game Splash Screen (opening scene of game presentation with own set of assets, commercial ad and etc.; can be closed via event ui_skip_titles)
  • Main Menu (scene of the main menu with own set of assets)
    • Basically have buttons:
      • New Game (will show first Game scene)
      • Quit Game (will function will open Ending scene)
      • Mute/Unmute (shared control)
      • Language switcher (shared control)
      • Repeat Opening (will show Opening scene)
  • Game Menu (scene of popup menu at game-time with own set of assets; can be opened/closed via event ui_toggle_game_menu)
    • Basically have buttons:
      • Return (will hide Game Menu and continue the game)
      • Exit to Main Menu (will show Main Menu scene)
      • Quit Game (function will open Ending scene)
      • Mute/Unmute (shared control)
      • Language Switcher (shared control)
  • Game (all game scenes and logic are here)
  • Ending (ending scene of the company/creator(s)/game presentation with own set of assets, commercial ad and etc.; can be closed via event ui_skip_titles)

Assets are Separated to:

  • Fonts (contains fonts)
  • Images (contains images, textures, sprites, etc.)
  • Locale (contains translation of UI)
  • Sounds (contains audio files, sound effects, music, etc.)
  • Video (contains video files for splash screen, demo-scenes, etc.)

Shared Controls:

  • Confirm (custom confirmation dialog without borders and title; has a question and two buttons: "Cancel" and "Ok")
  • Copyright (label with your own copyright; by default displays on Opening, Game Splash and Ending scenes)
  • LangSwitcher (dropdown list with available UI translations, basically available English, Spanish and Russian languages; by default displays on QuickSettings control)
  • Mute (button to mute/unmute, basically works with first bus with index 0; by default displays on QuickSettings control)
  • QuickSettings (horizontal panel with LangSwitcher and Mute controls; by default displays on Main Menu and Game Menu scenes)
  • SkipHint (label how to skip a splash screen / demo scene; by default displays on Opening, Game Splash and Ending scenes)
  • Joystick (controller for Joystick emulation; by default displays on Game scene)
    • Settings:
      • sensivity (skip N units before Joystick will be opened; by default 50)
      • permanent (true will always displays controller on scene, false - on demand; by default uses value of property visible)
      • use_up (use up direction; by default true)
      • use_down (use down direction; by default true)
      • use_left (use left direction; by default true)
      • use_right (use right direction; by default true)
    • Position:
      • stick_angle (read only)
      • stick_speed (read only)
      • stick_vector (read only)

Notes:

  • all animations and themes are saved in .tres text files to easiest changing
  • default screen resolution is WSVGA (1024x600)
  • enabled touch emulation
  • enabled 2d strech mode with expand aspect
  • sensor_landscape screen orientation
  • enabled oversampling usage for dynamic fonts
  • by default all controls and UI have a English (en_US) language
  • basically available also Spanish (es_ES) and Russian (ru_RU) translations
  • all translations are saved in .po text files to easiest changing
  • all text files have a UTF-8 encoding (sources, translations, text resources, etc.)
  • Computer Modern Unicode font (MIT) uses by default (placed to 0_Global/Accets/Fonts)
    • Basically uses in:
      • Entry/Margin.Theme:DefaultFont.tres
      • 0_Global/Copyright.Theme:DefaultLittleFont.tres
      • 0_Global/SkipHint.Theme:DefaultLittleFont.tres
      • 1_Opening/Opening.Theme:DefaultFont.tres
      • 2_GameSplash/GameSplash/GameTitle.Theme:DefaultFont.tres
      • 3_MainMenu/MainMenu/Margin.Theme:DefaultFont.tres
      • 4_GameMenu/GameMenu.Theme:DefaultFont.tres
      • 6_Ending/Ending/Margin.Theme:DefaultFont.tres

Installation and Usage:

  1. clone this repo to your local folder, open project in Godot and change project's settings to your own (title, resolution, etc.)
  2. change Opening (1_Opening/Opening.tscn) and Ending (6_Ending/Ending.tscn) scenes to your own (don't forget to change titles and logos "Veupix", see section Additionals for License below)
  3. change Game Splash Sreen scene (2_GameSplash/GameSplash.tscn)
  4. change Menu scenes
    1. add functionality for the Main Menu scene (3_MainMenu/MainMenu.tscn)
    2. add functionality for the Game Menu scene (4_GameMenu/GameMenu.tscn)
  5. make game-scenes and game-logic
    1. change Game scene (5_Game/Game.tscn) and add sub-scenes to make your own game logic_
    2. change (or delete) JoystickLogic (5_Game/JoystickLogic.gd) to make your own logic of the virtual controller
  6. add the multilanguage support
    1. add/remove languages (0_Global/Accets/Locale and Projcet Settings -> Localization -> Translations)
    2. expand the game translations (0_Global/Accets/Locale)

Additionals for License:

Template distributed under MIT license with the exception of title "Veupix" and logo images of "Veupix". You can't use this title and logo in your own projects and you should to change these to your own (note that by default title "Veupix" and logo "Veupix" can be found at Opening scene and Ending scene).