Documentation ¶
Overview ¶
世界
Index ¶
- Constants
- Variables
- func Buildable(structureType int, tx int, ty int) bool
- func CartesianToIso(x, y float64) (float64, float64)
- func Date() (month string, year string)
- func DrawStructure(structureType int) *ebiten.Image
- func HelpButtonAt(x, y int) int
- func IsoToCartesian(x, y float64) (float64, float64)
- func IsoToScreen(x, y float64) (float64, float64)
- func LevelCoordinatesToScreen(x, y float64) (float64, float64)
- func LoadTileset() error
- func ObjectToRect(o *tiled.Object) image.Rectangle
- func Reset()
- func ScreenToCartesian(x, y int) (float64, float64)
- func ScreenToIso(x, y int) (float64, float64)
- func SetHelpPage(page int)
- func SetHoverStructure(structureType int)
- func ShowBuildCost(structureType int, cost int)
- func ShowMessage(message string, duration int)
- func StartGame()
- func TickMessages()
- func TooltipText() string
- func ValidXY(x, y int) bool
- type GameLevel
- type GameWorld
- type HUDButton
- type PowerPlant
- type Structure
- type Tile
- type TileType
Constants ¶
View Source
const ( StructureToggleHelp = iota + 1 StructureBulldozer StructureRoad StructurePlain StationBusStop )
View Source
const ( MonthTicks = 144 * 5 YearTicks = MonthTicks * 12 TileSize = 64 SidebarWidth = 199 CameraMinZoom = 0.1 CameraMaxZoom = 10.0 GrassTile = uint32(0) )
Variables ¶
View Source
var ErrInvalidBuildingNotFit = errors.New("invalid location: building does not fit") // 建設場所が不適
View Source
var ErrLocationOccupied = errors.New("invalid location: space already occupied")
View Source
var ErrNothingToBulldoze = errors.New("nothing to bulldoze") // 取り壊すものがない
View Source
var ErrTileImageNotFound = errors.New("tile image not found")
View Source
var HUDButtons []*HUDButton
View Source
var HelpText = []string{`
Welcome to Mapp! (1/2)
`, `
This is last page... (2/2)
`,
}
HelpText lines must be 39 characters or less.
View Source
var StructureCosts = map[int]int{ StructureBulldozer: 5, StructureRoad: 25, StationBusStop: 50, }
実行に必要な額
View Source
var StructureFilePaths = map[int]string{ StructureBulldozer: "map/bulldozer.tmx", StructureRoad: "map/road.tmx", StructurePlain: "map/plain.tmx", StationBusStop: "map/busstop.tmx", }
タイルへのファイルパス
View Source
var StructureTooltips = map[int]string{ StructureToggleHelp: "Help", StructureBulldozer: "Bulldozer", StructureRoad: "Road", StationBusStop: "Bus Stop", }
ツールチップの文字列
View Source
var World = &GameWorld{ CamScale: startingZoom, CamScaleTarget: startingZoom, TileImages: make(map[uint32]*ebiten.Image), ResetGame: true, Level: NewLevel(256), BuildDragX: -1, BuildDragY: -1, LastBuildX: -1, LastBuildY: -1, Printer: message.NewPrinter(language.English), IsDebug: true, PreviewTileType: PlainTile, }
Functions ¶
func CartesianToIso ¶
CartesianToIso transforms cartesian coordinates into isometric coordinates.
func DrawStructure ¶ added in v1.2.0
func DrawStructure(structureType int) *ebiten.Image
func HelpButtonAt ¶
func IsoToCartesian ¶
CartesianToIso transforms cartesian coordinates into isometric coordinates.
func IsoToScreen ¶
func LoadTileset ¶
func LoadTileset() error
func ObjectToRect ¶
func ScreenToCartesian ¶
func ScreenToIso ¶
func SetHelpPage ¶
func SetHelpPage(page int)
func ShowBuildCost ¶
func ShowMessage ¶
Types ¶
type GameLevel ¶
type GameLevel struct { Tiles [][][]*Tile // contains filtered or unexported fields }
levelは高さのことっぽい
func (*GameLevel) ClearHoverSprites ¶
func (l *GameLevel) ClearHoverSprites()
タイル全体のHoverSpriteフラグをオフにする
type GameWorld ¶
type GameWorld struct { Level *GameLevel Player entity.Player ScreenW, ScreenH int IsDebug bool GameStarted bool GameStartedTicks int GameOver bool PlayerX, PlayerY float64 CamX, CamY float64 CamScale float64 CamScaleTarget float64 HoverStructure int // 選択中の建設物 HoverX, HoverY int HoverLastX, HoverLastY int HoverValid bool Map *tiled.Map TileImages map[uint32]*ebiten.Image TileImagesFirstGID uint32 ResetGame bool GotCursorPosition bool EnvironmentSprites int HUDUpdated bool HUDButtonRects []image.Rectangle HelpUpdated bool HelpPage int HelpButtonRects []image.Rectangle Ticks int Funds int Printer *message.Printer Messages []string // 右上に一時的に表示するメッセージ。MessagesとMessagesTicksのスライスの数は対応している MessagesTicks []int // 右上に一時的に表示するメッセージの残り秒 BuildDragX int BuildDragY int LastBuildX int LastBuildY int PreviewTileType TileType // 選択中の、プレビュー表示するタイルタイプ。TODO: エンティティに移動させる // contains filtered or unexported fields }
func (*GameWorld) SetGameOver ¶
type HUDButton ¶
type PowerPlant ¶
Click to show internal directories.
Click to hide internal directories.