annotate behaviours/player.py @ 84:bb9e2f2548c6

Added moveObject method to the GameModel class.
author KarstenBock@gmx.net
date Fri, 23 Sep 2011 15:08:27 +0200
parents 8b1ad2d342d8
children 57f1cff9a75d
rev   line source
30
ec5a55266f6a Moved behaviours from objects/actors.py to files seperate files inside a behaviours directory.
KarstenBock@gmx.net
parents:
diff changeset
1 # This file is part of PARPG.
ec5a55266f6a Moved behaviours from objects/actors.py to files seperate files inside a behaviours directory.
KarstenBock@gmx.net
parents:
diff changeset
2
ec5a55266f6a Moved behaviours from objects/actors.py to files seperate files inside a behaviours directory.
KarstenBock@gmx.net
parents:
diff changeset
3 # PARPG is free software: you can redistribute it and/or modify
ec5a55266f6a Moved behaviours from objects/actors.py to files seperate files inside a behaviours directory.
KarstenBock@gmx.net
parents:
diff changeset
4 # it under the terms of the GNU General Public License as published by
ec5a55266f6a Moved behaviours from objects/actors.py to files seperate files inside a behaviours directory.
KarstenBock@gmx.net
parents:
diff changeset
5 # the Free Software Foundation, either version 3 of the License, or
ec5a55266f6a Moved behaviours from objects/actors.py to files seperate files inside a behaviours directory.
KarstenBock@gmx.net
parents:
diff changeset
6 # (at your option) any later version.
ec5a55266f6a Moved behaviours from objects/actors.py to files seperate files inside a behaviours directory.
KarstenBock@gmx.net
parents:
diff changeset
7
ec5a55266f6a Moved behaviours from objects/actors.py to files seperate files inside a behaviours directory.
KarstenBock@gmx.net
parents:
diff changeset
8 # PARPG is distributed in the hope that it will be useful,
ec5a55266f6a Moved behaviours from objects/actors.py to files seperate files inside a behaviours directory.
KarstenBock@gmx.net
parents:
diff changeset
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
ec5a55266f6a Moved behaviours from objects/actors.py to files seperate files inside a behaviours directory.
KarstenBock@gmx.net
parents:
diff changeset
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
ec5a55266f6a Moved behaviours from objects/actors.py to files seperate files inside a behaviours directory.
KarstenBock@gmx.net
parents:
diff changeset
11 # GNU General Public License for more details.
ec5a55266f6a Moved behaviours from objects/actors.py to files seperate files inside a behaviours directory.
KarstenBock@gmx.net
parents:
diff changeset
12
ec5a55266f6a Moved behaviours from objects/actors.py to files seperate files inside a behaviours directory.
KarstenBock@gmx.net
parents:
diff changeset
13 # You should have received a copy of the GNU General Public License
ec5a55266f6a Moved behaviours from objects/actors.py to files seperate files inside a behaviours directory.
KarstenBock@gmx.net
parents:
diff changeset
14 # along with PARPG. If not, see <http://www.gnu.org/licenses/>.
ec5a55266f6a Moved behaviours from objects/actors.py to files seperate files inside a behaviours directory.
KarstenBock@gmx.net
parents:
diff changeset
15
55
8b1ad2d342d8 Renamed BaseBehaviour to MovingAgentBehaviour
KarstenBock@gmx.net
parents: 48
diff changeset
16 import moving
8b1ad2d342d8 Renamed BaseBehaviour to MovingAgentBehaviour
KarstenBock@gmx.net
parents: 48
diff changeset
17 from moving import MovingAgentBehaviour
30
ec5a55266f6a Moved behaviours from objects/actors.py to files seperate files inside a behaviours directory.
KarstenBock@gmx.net
parents:
diff changeset
18
55
8b1ad2d342d8 Renamed BaseBehaviour to MovingAgentBehaviour
KarstenBock@gmx.net
parents: 48
diff changeset
19 class PlayerBehaviour (MovingAgentBehaviour):
46
bf506f739322 Removed layer as attribute of BaseBehaviour and added it as a parameter to the attachToLayer method.
KarstenBock@gmx.net
parents: 34
diff changeset
20 def __init__(self, parent=None):
bf506f739322 Removed layer as attribute of BaseBehaviour and added it as a parameter to the attachToLayer method.
KarstenBock@gmx.net
parents: 34
diff changeset
21 super(PlayerBehaviour, self).__init__()
30
ec5a55266f6a Moved behaviours from objects/actors.py to files seperate files inside a behaviours directory.
KarstenBock@gmx.net
parents:
diff changeset
22 self.parent = parent
ec5a55266f6a Moved behaviours from objects/actors.py to files seperate files inside a behaviours directory.
KarstenBock@gmx.net
parents:
diff changeset
23 self.idle_counter = 1
ec5a55266f6a Moved behaviours from objects/actors.py to files seperate files inside a behaviours directory.
KarstenBock@gmx.net
parents:
diff changeset
24 self.speed = 0
ec5a55266f6a Moved behaviours from objects/actors.py to files seperate files inside a behaviours directory.
KarstenBock@gmx.net
parents:
diff changeset
25 self.nextAction = None
48
1bdadb768bcf Added approach functionality to the BaseBehaviour
KarstenBock@gmx.net
parents: 46
diff changeset
26 self.agent = None