GithubHelp home page GithubHelp logo

samsgame's Introduction

A game by Sam

A cool top down 2D pixel art game with adventures and online pvp in a big persistent world.

Join the fight! Be a contributor! :)

Press x to spawn or swing your mighty axe. Use arrow keys or WASD to move around. Use r and f to zoom in and out

Dependencies

On a Debian machine:

sudo apt install libgl1-mesa-dev xorg-dev

Run

To start the server:

go run ./server

To start the client:

go build ./client

samsgame's People

Contributors

makotoe avatar samoen avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

isgasho

samsgame's Issues

Unknown import

go version
go version go1.11.6 linux/amd64
go run .
package mahgame: unknown import path "mahgame": cannot find module providing package mahgame

Client runs even if assets were not found

If you try to run client from an incorrect directory, you get a panic (SIGSEGV), because the various images in gamecore/weaponRenderSystem.go cannot be found and are thus initialized to nil.

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x565cab]

goroutine 9 [running]:
github.com/hajimehoshi/ebiten.(*Image).isDisposed(...)
        /home/makoto/go/pkg/mod/github.com/hajimehoshi/[email protected]/image.go:57
github.com/hajimehoshi/ebiten.(*Image).DrawImage(0xc000028c80, 0x0, 0xc0001dba18, 0xc000302380, 0x4423d0)
        /home/makoto/go/pkg/mod/github.com/hajimehoshi/[email protected]/image.go:135 +0x4b
mahgame/gamecore.drawBackground(0xc000028c80)
        /home/makoto/Documents/samsgame/gamecore/weaponRenderSystem.go:110 +0x1d4
mahgame/gamecore.(*SamGame).Draw(0xb4cd70, 0xc000028c80)
        /home/makoto/Documents/samsgame/gamecore/entities.go:93 +0x32
github.com/hajimehoshi/ebiten.(*imageDumperGameWithDraw).Draw(0xc00007fa10, 0xc000028c80)
        /home/makoto/go/pkg/mod/github.com/hajimehoshi/[email protected]/run.go:230 +0x70
github.com/hajimehoshi/ebiten.(*uiContext).update(0xb008e0, 0xc0001b4420, 0x0, 0x0)
        /home/makoto/go/pkg/mod/github.com/hajimehoshi/[email protected]/uicontext.go:274 +0x255
github.com/hajimehoshi/ebiten.(*uiContext).Update(0xb008e0, 0xc0001b4420, 0x876d20, 0xb008e0)
        /home/makoto/go/pkg/mod/github.com/hajimehoshi/[email protected]/uicontext.go:239 +0xb4
github.com/hajimehoshi/ebiten/internal/uidriver/glfw.(*UserInterface).update(0xac24e0, 0x876d20, 0xb008e0, 0x415e6c, 0xb4ccd0)
        /home/makoto/go/pkg/mod/github.com/hajimehoshi/[email protected]/internal/uidriver/glfw/ui.go:810 +0x2dc
github.com/hajimehoshi/ebiten/internal/uidriver/glfw.(*UserInterface).loop(0xac24e0, 0x876d20, 0xb008e0, 0x0, 0x0)
        /home/makoto/go/pkg/mod/github.com/hajimehoshi/[email protected]/internal/uidriver/glfw/ui.go:856 +0xe5
github.com/hajimehoshi/ebiten/internal/uidriver/glfw.(*UserInterface).run(0xac24e0, 0x876d20, 0xb008e0, 0x0, 0x0)
        /home/makoto/go/pkg/mod/github.com/hajimehoshi/[email protected]/internal/uidriver/glfw/ui.go:728 +0x2fe
github.com/hajimehoshi/ebiten/internal/uidriver/glfw.(*UserInterface).Run.func1(0xc000012e20, 0xc00006a720, 0xac24e0, 0x876d20, 0xb008e0)
        /home/makoto/go/pkg/mod/github.com/hajimehoshi/[email protected]/internal/uidriver/glfw/ui.go:565 +0x85
created by github.com/hajimehoshi/ebiten/internal/uidriver/glfw.(*UserInterface).Run
        /home/makoto/go/pkg/mod/github.com/hajimehoshi/[email protected]/internal/uidriver/glfw/ui.go:562 +0x181
exit status 2

Because of this, I propose that we make a type Assets struct{} and a func NewAssets(assetsDir string) (*Assets, error). This way, we can avoid making globals, and ensure that we are handling errors correctly.

I would like to create a PR for this, but I wanted to get your opinions on this.

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.