@@ -72,27 +72,28 @@ def character_surf_initialize():
72
72
bullet_surf [name ] = surf
73
73
74
74
def update_img (entity , direction ):
75
- if (time .time () - entity .walking_cd ) > 0.25 :
76
- #print('updating')
77
- entity .walking_cd = time .time ()
78
- if direction != [0 , 0 ]:
79
- if entity .images ['now' ] == 'walking_1' :
80
- #print('change to walking_2')
81
- entity .images ['now' ] = 'walking_2'
82
- if direction [0 ] > 0 :
83
- entity .surf = entity .surf_dict ['walking_2' ]
84
- else :
85
- entity .surf = entity .surf_dict ['walking_2_reverse' ]
86
- else :
87
- entity .images ['now' ] = 'walking_1'
88
- #print('change to walking_1')
89
- if direction [0 ] > 0 :
90
- entity .surf = entity .surf_dict ['walking_1' ]
91
- else :
92
- entity .surf = entity .surf_dict ['walking_1_reverse' ]
75
+ if time .time () - entity .walking_cd <= 0.25 :
76
+ return
77
+ #print('updating')
78
+ entity .walking_cd = time .time ()
79
+ if direction == [0 , 0 ]:
80
+ entity .surf = entity .surf_dict ['standing' ]
81
+ entity .images ['now' ] = 'standing'
82
+
83
+ elif entity .images ['now' ] == 'walking_1' :
84
+ #print('change to walking_2')
85
+ entity .images ['now' ] = 'walking_2'
86
+ if direction [0 ] > 0 :
87
+ entity .surf = entity .surf_dict ['walking_2' ]
88
+ else :
89
+ entity .surf = entity .surf_dict ['walking_2_reverse' ]
90
+ else :
91
+ entity .images ['now' ] = 'walking_1'
92
+ #print('change to walking_1')
93
+ if direction [0 ] > 0 :
94
+ entity .surf = entity .surf_dict ['walking_1' ]
93
95
else :
94
- entity .surf = entity .surf_dict ['standing' ]
95
- entity .images ['now' ] = 'standing'
96
+ entity .surf = entity .surf_dict ['walking_1_reverse' ]
96
97
97
98
98
99
def update_bullet_image_direction (image , direction ):
0 commit comments