Golang

Create a Flappy Bird Clone With Golang P3

I hope that by trying removals and changing parameters, you have figured out what these lines of code do: op := &ebiten.DrawImageOptions{} op.GeoM.Translate(-float64(frameWidth)/2, -float64(frameHeight)/2) op.GeoM.Translate(screenWidth/2, screenHeight/2) In case you haven’t, let’s quickly check the Cheatsheet for ebiten.DrawImageOptions type DrawImageOptions struct { // GeoM is a geometry matrix to draw. // The default (zero) value is identify, which draws the image at (0, 0). GeoM GeoM // ColorM is a color matrix to draw.

Create a Flappy Bird Clone With Golang P2

Last time, we stopped at mentioning that there are three functions needed for the game loop: Update(), Draw() and Layout(), of which all are functions of the Game struct. According to the cheatsheet, the whole Game struct is an instance of the Game interface, as follow: type Game interface { // Update updates a game by one tick. The given argument represents a screen image. Update(screen *Image) error // Draw draw the game screen.

Create a Flappy Bird Clone With Golang P1

This weekend I decided to start another tutorial series in this blog, as I did learn a lot during making the last one. This time I decided to up the ante by picking up on a language that I am not very familiar with: Go Programming Language, or Golang. If it is the first time you heard of it, Go is a language designed at Google, is syntactically similar to C and is very well-designed to support concurrency.