allaie le slender!
This commit is contained in:
32
control.py
32
control.py
@@ -218,6 +218,16 @@ def coup_pied_droit():
|
||||
est_stop = 0
|
||||
ajoute_action("Coup de pied droit !")
|
||||
|
||||
def attention_obstacle():
|
||||
global est_stop
|
||||
est_stop = 0
|
||||
ajoute_action("Attention obstacle")
|
||||
|
||||
def attention_escalier():
|
||||
global est_stop
|
||||
est_stop = 0
|
||||
ajoute_action("Attention escalier")
|
||||
|
||||
print(inputs.devices.gamepads)
|
||||
|
||||
actions = {
|
||||
@@ -248,6 +258,8 @@ actions = {
|
||||
25 : saute,
|
||||
26 : coup_pied_gauche,
|
||||
27 : coup_pied_droit,
|
||||
28 : attention_obstacle,
|
||||
29 : attention_escalier,
|
||||
}
|
||||
|
||||
|
||||
@@ -282,6 +294,12 @@ pied_droit = 0
|
||||
prev_A = -1
|
||||
A = -1
|
||||
|
||||
prev_Y = -1
|
||||
Y = -1
|
||||
|
||||
prev_B = -1
|
||||
B = -1
|
||||
|
||||
prev_brase_gauche = -1
|
||||
bras_gauche = -1
|
||||
bras_gauche_tendu = 0
|
||||
@@ -314,6 +332,10 @@ while (True) :
|
||||
X = event.state
|
||||
if event.code == "BTN_SOUTH" :
|
||||
A = event.state
|
||||
if event.code == "BTN_EAST" :
|
||||
B = event.state
|
||||
if event.code == "BTN_WEST" :
|
||||
Y = event.state
|
||||
if event.code == "BTN_TL" :
|
||||
TL = event.state
|
||||
if event.code == "BTN_TR" :
|
||||
@@ -424,3 +446,13 @@ while (True) :
|
||||
if TR == 1 :
|
||||
actions[27]()
|
||||
prev_TR = TR
|
||||
|
||||
if B > -1 and not B == prev_B :
|
||||
if B == 1 :
|
||||
actions[29]()
|
||||
prev_B = B
|
||||
|
||||
if Y > -1 and not Y == prev_Y :
|
||||
if Y == 1 :
|
||||
actions[28]()
|
||||
prev_Y = Y
|
||||
|
||||
Reference in New Issue
Block a user