trinket/main.go

52 lines
680 B
Go

package main
import (
"fmt"
"math/rand"
"os"
"os/exec"
"time"
)
//Characters
var (
player = Character{
Name: "Daniel",
Health: 100,
Damage: 60,
Spell: firearrow,
Weapons: [5]Weapon{Broadsword}}
goblin = Character{
Name: "Goblin",
Health: 100,
Damage: 20,
Weapons: [5]Weapon{GoblinClaw}}
firearrow = Spell{
Name: "Fire Arrow",
Damage: 50,
Cost: 10,
Level: 1,
Active: true}
)
func main() {
initGame()
Battle(player, goblin)
fmt.Println(goblin.Weapons[0].Damage)
}
func initGame() {
rand.Seed(time.Now().Unix())
ClearScreen()
}
func ClearScreen() {
cmd := exec.Command("clear")
cmd.Stdout = os.Stdout
cmd.Run()
}