annotate pytouhou/games/sample/shots.py @ 698:05e0425a8bc5

ecl_vm: enable SetDeathCallback.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Fri, 23 Aug 2019 02:37:21 +0200
parents 2a748aa29c3f
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
600
2a748aa29c3f Add a sample character.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
1 # -*- encoding: utf-8 -*-
2a748aa29c3f Add a sample character.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
2 ##
2a748aa29c3f Add a sample character.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
3 ## Copyright (C) 2014 Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
2a748aa29c3f Add a sample character.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
4 ##
2a748aa29c3f Add a sample character.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
5 ## This program is free software; you can redistribute it and/or modify
2a748aa29c3f Add a sample character.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
6 ## it under the terms of the GNU General Public License as published
2a748aa29c3f Add a sample character.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
7 ## by the Free Software Foundation; version 3 only.
2a748aa29c3f Add a sample character.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
8 ##
2a748aa29c3f Add a sample character.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
9 ## This program is distributed in the hope that it will be useful,
2a748aa29c3f Add a sample character.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
10 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
2a748aa29c3f Add a sample character.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
11 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2a748aa29c3f Add a sample character.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
12 ## GNU General Public License for more details.
2a748aa29c3f Add a sample character.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
13 ##
2a748aa29c3f Add a sample character.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
14
2a748aa29c3f Add a sample character.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
15 from math import radians
2a748aa29c3f Add a sample character.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
16 from pytouhou.formats.exe import SHT, Shot
2a748aa29c3f Add a sample character.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
17
2a748aa29c3f Add a sample character.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
18
2a748aa29c3f Add a sample character.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
19 player = SHT()
2a748aa29c3f Add a sample character.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
20 player.horizontal_vertical_speed = 2.
2a748aa29c3f Add a sample character.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
21 player.horizontal_vertical_focused_speed = 1.5
2a748aa29c3f Add a sample character.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
22 player.diagonal_speed = 1.5
2a748aa29c3f Add a sample character.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
23 player.diagonal_focused_speed = 1.
2a748aa29c3f Add a sample character.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
24
2a748aa29c3f Add a sample character.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
25 shot = Shot()
2a748aa29c3f Add a sample character.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
26 shot.interval = 10
2a748aa29c3f Add a sample character.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
27 shot.delay = 5
2a748aa29c3f Add a sample character.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
28 shot.pos = (0, -32)
2a748aa29c3f Add a sample character.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
29 shot.hitbox = (5, 5)
2a748aa29c3f Add a sample character.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
30 shot.angle = radians(-90)
2a748aa29c3f Add a sample character.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
31 shot.speed = 5.
2a748aa29c3f Add a sample character.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
32 shot.damage = 16
2a748aa29c3f Add a sample character.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
33 shot.orb = 0
2a748aa29c3f Add a sample character.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
34 shot.type = 2
2a748aa29c3f Add a sample character.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
35 shot.sprite = 64
2a748aa29c3f Add a sample character.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
36 shot.unknown1 = 0
2a748aa29c3f Add a sample character.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
37
2a748aa29c3f Add a sample character.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
38 # Dict of list of shots, each for one power level.
2a748aa29c3f Add a sample character.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
39 # Always define at least the shot for max power, usually 999.
2a748aa29c3f Add a sample character.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
40 player.shots[999] = [shot]
2a748aa29c3f Add a sample character.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
41
2a748aa29c3f Add a sample character.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
42 # List of (unfocused, focused) shot types.
2a748aa29c3f Add a sample character.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
43 characters = [(player, player)]