Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/renanbastos93/gophermoves
Go package for simulating the movements of a character.
https://github.com/renanbastos93/gophermoves
Last synced: 18 days ago
JSON representation
Go package for simulating the movements of a character.
- Host: GitHub
- URL: https://github.com/renanbastos93/gophermoves
- Owner: renanbastos93
- License: mit
- Created: 2023-12-06T04:23:56.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-04-08T16:37:06.000Z (7 months ago)
- Last Synced: 2024-10-06T16:41:10.037Z (about 1 month ago)
- Language: Go
- Size: 13.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Gopher Moves
GopherMoves is a Go package that provides an interface and an example implementation for simulating the movements of a character, particularly designed for a Gopher character.
https://github.com/renanbastos93/gophermoves/assets/8202898/4ecaa097-08e4-4a67-a80f-a311b6e1af67
## Table of Contents
- [Installation](#installation)
- [Usage](#usage)
- [Interface Methods](#interface-methods)
- [Contributing](#contributing)
- [License](#license)## Installation
To use GopherMoves in your Go project, you can simply run:
```bash
go get -u github.com/renanbastos93/gophermoves
```## Usage
```go
package mainimport "github.com/renanbastos93/gophermoves"
func main() {
orderMatrix := 5
g := gophermoves.New(orderMatrix)
err := g.Start()
if err != nil {
panic(err.Error())
}
}
```## Interface Methods
The GopherMoves interface provides the following methods:
- `Start() (err error)`: Initiates movements for the character.
- `Reset()`: Redefines the default states of the X and Y positions.
- `Up()`: Moves the character upward.
- `Down()`: Moves the character downward.
- `Left()`: Turns the character to the left.
- `Right()`: Turns the character to the right.## Contributing
Feel free to contribute to this project. If you find any issues or have suggestions, please open an issue or submit a pull request.
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.