-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplayer.go
56 lines (52 loc) · 903 Bytes
/
player.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package main
import "github.com/ronoaldo/ld-50/assets"
type Player struct {
name string
game *Game
inv *Inventory
}
func NewPlayer(g *Game) *Player {
p := &Player{
name: "Bob",
}
p.game = g
p.inv = NewInventory(p)
p.inv.AddDroid(&Droid{
Name: "Blue Lvl 1",
Level: 1,
Sprite: assets.BlueL1,
BaseStats: Stats{
HP: 100,
MaxHP: 100,
Strengh: 20,
Speed: 10,
},
Skills: [3]Skill{
BasicAttackSkill,
HealSkill,
UltimateAttackSkill,
},
})
p.inv.AddDroid(&Droid{
Name: "Octopus",
Level: 2,
Sprite: assets.OctopusEnemi,
BaseStats: Stats{
HP: 100,
MaxHP: 100,
Strengh: 20,
Speed: 10,
},
Skills: [3]Skill{
BasicAttackSkill,
HealSkill,
UltimateAttackSkill,
},
})
p.inv.AddChip(NewChip())
p.inv.AddChip(NewChip())
p.inv.AddChip(NewChip())
p.inv.AddChip(NewChip())
p.inv.AddChip(NewChip())
return p
}