Documentation ¶
Overview ¶
Package game Copyright (C) 2020 Loïg Jezequel
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
Package game Copyright (C) 2020 Loïg Jezequel ¶
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
Package game Copyright (C) 2020 Loïg Jezequel ¶
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
Package game Copyright (C) 2020 Loïg Jezequel ¶
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
Package game Copyright (C) 2020 Loïg Jezequel ¶
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
Package game Copyright (C) 2020 Loïg Jezequel ¶
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
Package game Copyright (C) 2020 Loïg Jezequel ¶
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
Index ¶
- Constants
- Variables
- type Focus
- type Game
- func (g *Game) Draw(screen *ebiten.Image)
- func (g *Game) InitGame()
- func (g *Game) Layout(outsideWidth, outsideHeigth int) (screenWidth, screenHeight int)
- func (g *Game) PlaySound(soundName SoundName)
- func (g *Game) ResetAnimation()
- func (g *Game) Update(screen *ebiten.Image) error
- func (g *Game) UpdateAnimation()
- func (g *Game) UpdateEndGameAnimation()
- func (g *Game) UpdateEndLevelAnimation()
- func (g *Game) UpdateFallingTilesAnimation()
- func (g *Game) UpdateFlowerAnimation()
- func (g *Game) UpdatePlayerAnimation()
- type PState
- type SoundName
- type State
Constants ¶
const ( InfoBlock = "A game developped in 48h\n by Loig Jezequel\n for Ludum Dare 46!\n(see https://ldjam.com)" InfoBlock2 = "All images and sound are" InfoBlock3 = " Code source under GPL-3.0\n available at\n https://github.com/loig/ld46" )
Menus animation management
const ( Title = "ld46" ScreenWidth = 256 ScreenHeight = 256 )
Constants defining the basic parameters of the game
Variables ¶
var ErrEndGame = errors.New("End")
ErrEndGame is raised at the end of a game
Functions ¶
This section is empty.
Types ¶
type Game ¶
type Game struct { GameState State StateAfterMenu State PlayerAnimationStep int PlayerAnimationFrame int FlowerAnimationStep int FlowerAnimationFrame int EndLevelStep int EndLevelAnimationStep int EndLevelAnimationFrame int EndGameAnimationStep int EndGameAnimationFrame int FallingTilesAnimationStep map[level.TilePosition]int FallingTilesAnimationFrame map[level.TilePosition]int PlayerState PState PlayerX int PlayerY int FlowerState level.Object ResetLevel level.Level CurrentLevel level.Level LevelNumber int TutoNumber int Tiles *ebiten.Image MenuFocus Focus DisplayFont font.Face InfoFont font.Face Scores [5]int TotalScores [5]int AudioContext *audio.Context SoundPlayers [numSound]*audio.Player MusicPlayer *audio.Player }
Game defines the general game structure
func (*Game) InitGame ¶
func (g *Game) InitGame()
InitGame performs all necessary stuff before starting a game, except for media loading
func (*Game) ResetAnimation ¶
func (g *Game) ResetAnimation()
ResetAnimation restarts all the animations
func (*Game) UpdateAnimation ¶
func (g *Game) UpdateAnimation()
UpdateAnimation determines the step of the animation of each element of the game
func (*Game) UpdateEndGameAnimation ¶
func (g *Game) UpdateEndGameAnimation()
UpdateEndGameAnimation determines the step of the final animation
func (*Game) UpdateEndLevelAnimation ¶
func (g *Game) UpdateEndLevelAnimation()
UpdateEndLevelAnimation determines the step of the animation transition between levels
func (*Game) UpdateFallingTilesAnimation ¶
func (g *Game) UpdateFallingTilesAnimation()
UpdateFallingTilesAnimation determines the step of the animation of every currently falling tile
func (*Game) UpdateFlowerAnimation ¶
func (g *Game) UpdateFlowerAnimation()
UpdateFlowerAnimation determines the step of the animation of the player
func (*Game) UpdatePlayerAnimation ¶
func (g *Game) UpdatePlayerAnimation()
UpdatePlayerAnimation determines the step of the animation of the player