Commit 55719521 authored by Baptiste HEYRENDT's avatar Baptiste HEYRENDT
Browse files

Merge branch 'CliApp'

parents 064feaa5 af69650b
src/project-particles
\ No newline at end of file
project-particles
project-particles.exe
\ No newline at end of file
{
"WindowTitle": "Default",
"WindowSizeX": 800,
"WindowSizeY": 600,
"ParticleImage": "assets/particle.png",
"Debug": true,
"InitNumParticles": 10,
"RandomSpawn": true,
"SpawnX": 400,
"SpawnY": 400,
"SpawnRate": 0,
"SpeedLimit": [0,20,0,0],
"Colors": [1,1,1,1,1,1]
}
......@@ -5,10 +5,10 @@
"ParticleImage": "assets/particle.png",
"Debug": true,
"InitNumParticles": 10,
"RandomSpawn": false,
"RandomSpawn": true,
"SpawnX": 400,
"SpawnY": 400,
"SpawnRate": 1,
"SpeedLimit": [-1,1,-1,1],
"SpawnRate": 0,
"SpeedLimit": [0,0,0,0],
"Colors": [1,1,1,1,1,1]
}
......@@ -6,6 +6,7 @@ require (
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20210727001814-0db043d8d5be // indirect
github.com/hajimehoshi/ebiten/v2 v2.2.2
github.com/jezek/xgb v0.0.0-20210312150743-0e0f116e1240 // indirect
github.com/urfave/cli v1.22.5
golang.org/x/exp v0.0.0-20190731235908-ec7cb31e5a56 // indirect
golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d // indirect
golang.org/x/mobile v0.0.0-20210902104108-5d9a33257ab5 // indirect
......
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d h1:U+s90UTSYgptZMwQh2aRr3LuazLJIa+Pg3Kc1ylSYVY=
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20210727001814-0db043d8d5be h1:vEIVIuBApEBQTEJt19GfhoU+zFSV+sNTa9E9FdnRYfk=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20210727001814-0db043d8d5be/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/hajimehoshi/bitmapfont/v2 v2.1.3/go.mod h1:2BnYrkTQGThpr/CY6LorYtt/zEPNzvE/ND69CRTaHMs=
......@@ -14,6 +17,13 @@ github.com/jezek/xgb v0.0.0-20210312150743-0e0f116e1240/go.mod h1:3P4UH/k22rXyHI
github.com/jfreymuth/oggvorbis v1.0.3/go.mod h1:1U4pqWmghcoVsCJJ4fRBKv9peUJMBHixthRlBeD6uII=
github.com/jfreymuth/vorbis v1.0.2/go.mod h1:DoftRo4AznKnShRl1GxiTFCseHr4zR9BN3TWXyuzrqQ=
github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4/go.mod h1:4OwLy04Bl9Ef3GJJCoec+30X3LQs/0/m4HFRt/2LUSA=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q=
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo=
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
github.com/urfave/cli v1.22.5 h1:lNq9sAHXK2qfdI8W+GRItjCEkI+2oR4d+MEHy1CKXoU=
github.com/urfave/cli v1.22.5/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
......@@ -64,3 +74,5 @@ golang.org/x/tools v0.1.6/go.mod h1:LGqMHiF4EqQNHR1JncWGqT5BVaXmza+X+BDGol+dOxo=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
package main
import (
"github.com/hajimehoshi/ebiten/v2"
"log"
"project-particles/assets"
"project-particles/config"
"project-particles/particles"
"github.com/hajimehoshi/ebiten/v2"
"os"
"github.com/urfave/cli"
)
// main est la fonction principale du projet. Elle commence par lire le fichier
......@@ -14,9 +19,41 @@ import (
// particules encapsulé dans un "game" et appelle la fonction RunGame qui se
// charge de faire les mise-à-jour (Update) et affichages (Draw) de manière
// régulière.
func main() {
config.Get("config.json")
var app = cli.NewApp()
func info() {
app.Name = "Particules"
app.Usage = "A CLI app to generate particle"
app.Author = "Léo Tranchet, Mathys Meunier, Lana Heyrendt"
app.Version = "0.0.1"
}
func commands() {
app.Commands = []cli.Command{
{
Name: "Default",
Aliases: []string{"d"},
Usage: "Use the default config file",
Action: func(c *cli.Context) {
ExecPart("config.json")
},
},
{
Name: "Wesh",
Aliases: []string{"w"},
Usage: "Use the default config file",
Action: func(c *cli.Context) {
ExecPart("./Extension/Wesh.json")
},
},
}
}
func ExecPart(cfg string) {
config.Get(cfg)
assets.Get()
ebiten.SetWindowTitle(config.General.WindowTitle)
......@@ -29,3 +66,12 @@ func main() {
log.Print(err)
}
}
func main() {
info()
commands()
err := app.Run(os.Args)
if err != nil {
log.Fatal(err)
}
}
File deleted
File deleted
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment