Documentation ¶
Overview ¶
Package general will store all the common functionality that all scenes can use.
Index ¶
Constants ¶
View Source
const ( // Background is the background image of the stage. // In a top down perspective this would be the floor. Background float32 = iota - 1 // Scene contains all scene objects for decoration. // This would include a collidable barrel for instance. // Or the walls of the scene. Scene // Enemies stores the enemy characters in the scene // that the player can interact with directly. Enemies // Player contains the playable character itself. // This is a high priority render. Player // Particles holds all the special effect particles. // This could include explosions and bullets. Particles // MenuBackground is for the background of a menu. This could be // a flat image for the main menu or a blurry dark half opacity for options. MenuBackground // MenuGraphics is for the buttons and misc. graphics to go over the menu. MenuGraphics )
View Source
const ( BtnLeft = "left" BtnRight = "right" BtnUp = "up" BtnDown = "down" )
View Source
const DrawScale float32 = 4.0
DrawScale is the default multiplier when drawing tiles and objects in the game.
View Source
const Solid common.CollisionGroup = 1
Solid is used for any solid colliders that should have a collision box with the player.
Variables ¶
This section is empty.
Functions ¶
func ChangeConfig ¶
ChangeConfig takes your viper to the configuration file along with a key you want to change and its new value then will be saved to your config file.
Types ¶
type Basic ¶
type Basic struct { // EntityScale controls the size at which // the object's entity is rendered at. (multiplier) EntityScale float32 // Spritesheet contains all the drawables used by // the engo RenderComponent. Spritesheet *common.Spritesheet // Ase is used to keep track of what frame // is being played animation by animation using jsons. Ase *goaseprite.File }
Basic contains essential pieces to render an object in the game.
type Configuration ¶
type Configuration struct { Window window `mapstructure:"window"` Settings settings `mapstructure:"settings"` Controls controls `mapstructure:"controls"` }
Configuration is the global object used to hold game settings
func LoadViperConfig ¶
func LoadViperConfig() *Configuration
LoadViperConfig loads a configuration file and returns a new copy of the data via a Configuration struct and viper object.
Click to show internal directories.
Click to hide internal directories.