-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathexample.py
More file actions
25 lines (22 loc) · 820 Bytes
/
example.py
File metadata and controls
25 lines (22 loc) · 820 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import argparse
import pynoko
def main(args):
mkw = pynoko.KHostSystem()
mkw.configureTimeTrial(pynoko.Course.Bowsers_Castle, pynoko.Character.Funky_Kong, pynoko.Vehicle.Flame_Runner, False)
mkw.configureGhost(args.ghost)
mkw.init()
print("MKW initialized")
buttons = pynoko.buttonInput([pynoko.KPAD_BUTTON_A])
print(f"buttons: {buttons}")
for i in range(30000):
mkw.setInput(buttons, 7, 0, pynoko.Trick.NoTrick)
mkw.calc()
print(mkw.kartObjectProxy())
print(mkw.raceCompletion())
mkw.reset()
print("MKW race reset")
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Run MKW with selected ghost file.")
parser.add_argument("ghost", help="Path to the .rkg ghost file")
args = parser.parse_args()
main(args)