Coder Social home page Coder Social logo

gocastle's Introduction

GoCastle

Introduction

This project is my journey to creating a graphical game while learning Golang

Every session, I'll add an entry in this file telling what I did and what I learned (see developpement_diary/)

Prerequisites

sudo apt-get install golang gcc libgl1-mesa-dev xorg-dev

Also, for building releases, you need goreleaser and fyne-cross

go install github.com/fyne-io/fyne-cross@latest

For the development, you need to install Golangci-lint

Contributions

Contributions are welcome but I need you to follow a few rules:

  • the primary goal of this project is for me to learn Go while having fun (game dev is so much fun). Keep that in mind when asking / proposing modifications.
  • since I'm a beginner, my code quality can be improved and I've a lot to learn. Fixing my code where it's badly written or helping me learn better patterns is greatly appreciated, but please add a little context/explaination so I can grow from your contributions. See developpement_diary/ folder.
  • most of the future work for the game is written in the Issues of this project. You look at them and ask me if you can take those!
    • issues labelled "game design" are by default reserved to me (@zwindler) since this needs not only code but also thinking about how the game will work.
    • issues labelled "good first issues" are self explainatory ;-).
    • issues labelled "on hold" as well.
    • issues labelled "refactoring" need to be discussed first. I openned a Discord server for this, please ask me the details.

Most importantly, have fun!

Build, test, release

Build only

make build

Build and run (useful in dev)

make buildrun

Release (using goreleaser)

git tag -a 0.0.1 -m "0.0.1 release"
goreleaser --clean

Test release (against code not tagged)

goreleaser --snapshot --clean

Note: for darwin compilation, we need fyne-cross which requires having locally the XCode SDK, especially Command_Line_Tools_for_Xcode_12.4.dmg. Download it here. See fyne-cross documentation for more information.

gocastle's People

Contributors

zwindler avatar azrod avatar abhirammgi avatar

Stargazers

Alexandre avatar astrolemonade avatar Julien Briault avatar DUVAL Olivier avatar  avatar Tanguy ⧓ Herrmann avatar Thomas Labarussias avatar David Aparicio avatar Rodrigo Osorio avatar Jérémy DEMANGE avatar

Watchers

 avatar  avatar  avatar

Forkers

abhirammngi azrod

gocastle's Issues

fix: errors when starting the game

2023/07/17 21:37:06 Fyne error:  Attempt to access current Fyne app when none is started
2023/07/17 21:37:06   At: /home/zwindler/go/pkg/mod/fyne.io/fyne/[email protected]/app.go:104
2023/07/17 21:37:06 Fyne error:  Attempt to access current Fyne app when none is started
2023/07/17 21:37:06   At: /home/zwindler/go/pkg/mod/fyne.io/fyne/[email protected]/app.go:104
2023/07/17 21:37:06 Fyne error:  Attempt to access current Fyne app when none is started
2023/07/17 21:37:06   At: /home/zwindler/go/pkg/mod/fyne.io/fyne/[email protected]/app.go:104
2023/07/17 21:37:06 Fyne error:  Attempt to access current Fyne app when none is started
2023/07/17 21:37:06   At: /home/zwindler/go/pkg/mod/fyne.io/fyne/[email protected]/app.go:104

chore: try to improve performance by generating maps as 1 PNG trop the tilemap

Performance is really poor right now, maps takes a lot of time to display on laptops and even more on mobile devices, probably due to fyne not being designed to display thousands of individual images. On my desktop, I didn't "see" the issue, map transitions take <200 ms to display. On my laptop though, it's >500ms and even worse on my smartphone.

This may (or may not) be a reason for #4

In order to make things more efficient, I had the idea to create the full map as one image for fyne instead of thousand of little ones. For pre-generated maps, it's "easy", I could do it by hand once I'm satisfied with how they look. But for generated maps, it's not possible.

So I have to modify the code to stop using a huge matrix containing lots of tiny images and generate the big map with all the tiles on the fly.

To make sure this is a good idea, I also have to check how long it takes to generate the whole map because Fog Of War implies that we have to regenerate the map PNG every time the player reveals more of the map.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.