annotate src/parpg/behaviours/player.py @ 146:6e1eb964a6e5

Fixed dropping items on the map.
author KarstenBock@gmx.net
date Mon, 03 Oct 2011 18:25:31 +0200
parents ecac92680bef
children
rev   line source
133
ecac92680bef Added animation queue and method the base behaviour class.
KarstenBock@gmx.net
parents: 82
diff changeset
1 # This file is part of PARPG.
ecac92680bef Added animation queue and method the base behaviour class.
KarstenBock@gmx.net
parents: 82
diff changeset
2
ecac92680bef Added animation queue and method the base behaviour class.
KarstenBock@gmx.net
parents: 82
diff changeset
3 # PARPG is free software: you can redistribute it and/or modify
ecac92680bef Added animation queue and method the base behaviour class.
KarstenBock@gmx.net
parents: 82
diff changeset
4 # it under the terms of the GNU General Public License as published by
ecac92680bef Added animation queue and method the base behaviour class.
KarstenBock@gmx.net
parents: 82
diff changeset
5 # the Free Software Foundation, either version 3 of the License, or
ecac92680bef Added animation queue and method the base behaviour class.
KarstenBock@gmx.net
parents: 82
diff changeset
6 # (at your option) any later version.
ecac92680bef Added animation queue and method the base behaviour class.
KarstenBock@gmx.net
parents: 82
diff changeset
7
ecac92680bef Added animation queue and method the base behaviour class.
KarstenBock@gmx.net
parents: 82
diff changeset
8 # PARPG is distributed in the hope that it will be useful,
ecac92680bef Added animation queue and method the base behaviour class.
KarstenBock@gmx.net
parents: 82
diff changeset
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
ecac92680bef Added animation queue and method the base behaviour class.
KarstenBock@gmx.net
parents: 82
diff changeset
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
ecac92680bef Added animation queue and method the base behaviour class.
KarstenBock@gmx.net
parents: 82
diff changeset
11 # GNU General Public License for more details.
ecac92680bef Added animation queue and method the base behaviour class.
KarstenBock@gmx.net
parents: 82
diff changeset
12
ecac92680bef Added animation queue and method the base behaviour class.
KarstenBock@gmx.net
parents: 82
diff changeset
13 # You should have received a copy of the GNU General Public License
ecac92680bef Added animation queue and method the base behaviour class.
KarstenBock@gmx.net
parents: 82
diff changeset
14 # along with PARPG. If not, see <http://www.gnu.org/licenses/>.
ecac92680bef Added animation queue and method the base behaviour class.
KarstenBock@gmx.net
parents: 82
diff changeset
15
ecac92680bef Added animation queue and method the base behaviour class.
KarstenBock@gmx.net
parents: 82
diff changeset
16 import moving
ecac92680bef Added animation queue and method the base behaviour class.
KarstenBock@gmx.net
parents: 82
diff changeset
17 from moving import MovingAgentBehaviour
ecac92680bef Added animation queue and method the base behaviour class.
KarstenBock@gmx.net
parents: 82
diff changeset
18
ecac92680bef Added animation queue and method the base behaviour class.
KarstenBock@gmx.net
parents: 82
diff changeset
19 class PlayerBehaviour (MovingAgentBehaviour):
ecac92680bef Added animation queue and method the base behaviour class.
KarstenBock@gmx.net
parents: 82
diff changeset
20 def __init__(self, parent=None):
ecac92680bef Added animation queue and method the base behaviour class.
KarstenBock@gmx.net
parents: 82
diff changeset
21 super(PlayerBehaviour, self).__init__()
ecac92680bef Added animation queue and method the base behaviour class.
KarstenBock@gmx.net
parents: 82
diff changeset
22 self.parent = parent
ecac92680bef Added animation queue and method the base behaviour class.
KarstenBock@gmx.net
parents: 82
diff changeset
23 self.idle_counter = 1
ecac92680bef Added animation queue and method the base behaviour class.
KarstenBock@gmx.net
parents: 82
diff changeset
24 self.speed = 0
75
c3350fc9cd45 Added approach functionality to the BaseBehaviour
KarstenBock@gmx.net
parents: 73
diff changeset
25 self.agent = None