Documentation
¶
Index ¶
- Constants
- Variables
- func HandleCollisionForWormOrWormPart(master *Worm, x, y float64)
- func LerpBias(time, bias float64) float64
- func LerpGain(time, gain float64) float64
- func WallSpeed() float64
- type Background
- type Checkpoint
- type GameController
- type GameScore
- type LerpDir
- type Medal
- type Menu
- type MenuGameover
- type Notification
- type PersistentGameData
- type Physics
- type Wall
- type WallSpawner
- type Worm
- type WormBody
- type WormHole
- type WormLag
Constants ¶
View Source
const ( WindowTitle = "Worm in the Pipes" WindowWidth = 960 WindowHeight = 640 WindowScale = 1 CreditText = "Created by Silbinary Wolf | Art by milkroscope | Music by Magicdweedoo" )
View Source
const ( DepthBackground = 10 DepthDirt = 1 DepthWormBody = -5 DepthWorm = -10 DepthMenu = -15 )
View Source
const ( LerpSpeed = 0.1 LerpTimer = 4 * (LerpSpeed * 60) )
View Source
const ( FrontCityHspeed = -2 BackCityHspeed = -1 )
View Source
const ( WormStartingBodyParts = 1 WormMaxBodyParts = 10 WormStartX = 304 WormStartY = 528 WormLeapPower = -21 WormJumpGravity = 0.66 WormFallGravity = 0.56 WormDieGravity = 0.58 WormSproutSpeed = 0.05 WormSinCounterStart = 9999999 // used in original game. Could just count up instead but kept it )
View Source
const ( SproutLerp = 0.1 SproutLerpSpeed = 0.1 SeperationWidth = 40 // Taken from game logic: (sprite_get_width(sprite_index) >> 1) + (sprite_get_width(sprite_index) >> 2); )
View Source
const ( // DesignedMaxTPS states that game logic is designed to simulate at 1/60 of a second // ie. alarms, move speed, animation speed DesignedMaxTPS = 60 )
View Source
const (
MenuFadeOutSpeed = 0.05
)
View Source
const (
MenuGameOverAccelerationSpeed = 3
)
Variables ¶
View Source
var Global = new(GameController)
Functions ¶
func LerpBias ¶
Lerp Bias http://blog.demofox.org/2012/09/24/bias-and-gain-are-your-friend/ http://demofox.org/biasgain.html
LerpBias was a script in the original Game Maker source code and has been copied across as is, including the comments referencing sources above.
func LerpGain ¶
Lerp Gain http://blog.demofox.org/2012/09/24/bias-and-gain-are-your-friend/ http://demofox.org/biasgain.html
LerpGain was a script in the original Game Maker source code and has been copied across as is, including the comments referencing sources above.
Types ¶
type Background ¶
type Background struct { gml.Object IsPaused bool BackCityOffset float64 FrontCityOffset float64 FrontGrassOffset float64 }
func (*Background) Create ¶
func (self *Background) Create()
func (*Background) Draw ¶
func (self *Background) Draw()
func (*Background) Update ¶
func (self *Background) Update()
type Checkpoint ¶
func (*Checkpoint) Create ¶
func (self *Checkpoint) Create()
func (*Checkpoint) Update ¶
func (self *Checkpoint) Update()
type GameController ¶
type GameController struct { gml.Controller PersistentGameData PreviousRound GameScore CurrentRound GameScore Notification Notification Player gml.InstanceIndex MusicPlaying audio.SoundIndex Score int }
func (*GameController) GamePostDraw ¶
func (*GameController) GamePostDraw()
func (*GameController) GamePreUpdate ¶
func (*GameController) GamePreUpdate()
func (*GameController) GameReset ¶
func (*GameController) GameReset()
func (*GameController) GameStart ¶
func (*GameController) GameStart()
func (*GameController) HasWormStopped ¶
func (*GameController) HasWormStopped() bool
func (*GameController) MusicRandomizeTrack ¶
func (*GameController) MusicRandomizeTrack()
type MenuGameover ¶
type MenuGameover struct { gml.Object Physics RetryButton gml.Rect IsHoveringOnMenu bool DisplayScore GameScore MedalDisplayUpdateTimer alarm.Alarm }
func (*MenuGameover) Create ¶
func (self *MenuGameover) Create()
func (*MenuGameover) Destroy ¶
func (self *MenuGameover) Destroy()
func (*MenuGameover) Draw ¶
func (self *MenuGameover) Draw()
func (*MenuGameover) Update ¶
func (self *MenuGameover) Update()
type Notification ¶
func (*Notification) Draw ¶
func (self *Notification) Draw()
func (*Notification) SetNotification ¶
func (self *Notification) SetNotification(text string)
func (*Notification) Update ¶
func (self *Notification) Update()
type PersistentGameData ¶
type Wall ¶
type Wall struct { gml.Object // Special flag where wall is jutting into the ground // but not enough that the player should die. DontKillPlayerIfInDirt bool // Special flag for when you reset the game, walls that // existed from the previous game will still render on-screen // but they won't kill you DontKillPlayer bool }
type WallSpawner ¶
type WallSpawner struct { WallList []wall.WallInfo SpawnWallTimer alarm.Alarm PreviousWallSpawned int }
func (*WallSpawner) Reset ¶
func (self *WallSpawner) Reset()
func (*WallSpawner) Update ¶
func (self *WallSpawner) Update(roomInstanceIndex gml.RoomInstanceIndex)
type Worm ¶
type Worm struct { gml.Object Physics WormLag WallSpawner BodyParts [WormMaxBodyParts]WormBody Start gml.Vec Score float64 Dead bool InAir bool FlapCounter float64 WingCount float64 // contains filtered or unexported fields }
func (*Worm) CalcMedals ¶
func (self *Worm) CalcMedals()
func (*Worm) ScoreIncrease ¶
func (self *Worm) ScoreIncrease()
func (*Worm) SetStartingBodyParts ¶
SetStartingBodyParts allows the Create() event and tests setup how many body parts trail the worm
func (*Worm) TriggerDeath ¶
func (self *Worm) TriggerDeath()
type WormBody ¶
func (*WormBody) SeperationWidth ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.