forked from InfoProjekt/game
		
	Development #11
					 1 changed files with 11 additions and 3 deletions
				
			
		|  | @ -75,8 +75,16 @@ class NPC(Objects): | ||||||
|             self.conversation.draw(screen) |             self.conversation.draw(screen) | ||||||
|      |      | ||||||
|     def update(self, keys, objects):  |     def update(self, keys, objects):  | ||||||
|  |         if self.lastUpdate + 200 < pg.time.get_ticks(): | ||||||
|             if self.talking: |             if self.talking: | ||||||
|                 self.conversation.update(keys, objects) |                 self.conversation.update(keys, objects) | ||||||
|  |                 self.lastUpdate = pg.time.get_ticks() | ||||||
|  |             else: | ||||||
|  |                 touches = pg.sprite.spritecollideany(self, objects[0]) | ||||||
|  |                 if touches is not None and keys[pg.K_f] and isinstance(touches, MainCharacter): | ||||||
|  |                     self.talk(objects)  | ||||||
|  |                     self.lastUpdate = pg.time.get_ticks() | ||||||
|  | 
 | ||||||
| 
 | 
 | ||||||
| class Convo(Label): | class Convo(Label): | ||||||
|     def __init__(self, text, convo_act, person, x = 140, y = 600, width = 1000, height = 100, font='simple', font_size = 20) -> None: |     def __init__(self, text, convo_act, person, x = 140, y = 600, width = 1000, height = 100, font='simple', font_size = 20) -> None: | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue