-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhuntsman.py
63 lines (55 loc) · 1.25 KB
/
huntsman.py
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
57
58
59
60
61
62
import argparse
parser = argparse.ArgumentParser(
description="Huntsman is a game that use steering behaviours.")
parser.add_argument(
'-r', '--res',
dest='res',
type=int,
nargs=2,
metavar=('WIDTH', 'HEIGHT'),
default=(900, 600),
help='game window resolution')
parser.add_argument(
'-ws', '--wsize',
dest='wsize',
type=int,
nargs=2,
metavar=('WIDTH', 'HEIGHT'),
default=(1500, 1000),
help='size of game world')
parser.add_argument(
'-hr', '--hares',
dest='hares',
type=int,
default=5,
help='amount of hares')
parser.add_argument(
'-wl', '--wolves',
dest='wolves',
type=int,
default=2,
help='amount of wolves')
parser.add_argument(
'-df', '--deerflocks',
dest='deerflocks',
type=int,
default=3,
help='amount of deer families')
parser.add_argument(
'-cs', '--camscale',
dest='camscale',
type=float,
default=1.3,
help='scale of camera inside game')
args = parser.parse_args()
import pygame
from game import View, Model
pygame.init()
screen = pygame.display.set_mode(args.res)
model = Model(
args.wsize,
hares=args.hares,
wolves=args.wolves,
deer_families=args.deerflocks)
v = View(screen, model, args.camscale)
v.start()