Want more features on Pastebin? Sign Up, it's FREE!
Guest

CombatManager.py

By: a guest on Oct 22nd, 2011  |  syntax: Python  |  size: 1.30 KB  |  views: 96  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. from PersonClass import *
  2. import android
  3. from BattleClass import *
  4.  
  5. droid = android.Android()
  6. urlPath = "file:///sdcard/sl4a/scripts/ExaltedCombatManager"
  7. filePath = "/sdcard/sl4a/scripts/ExaltedCombatManager"
  8.  
  9. '''
  10. droid.dialogCreateInput("Testing","Enter Number","0","number")
  11. droid.dialogSetPositiveButtonText("Enter")
  12.  
  13. droid.dialogShow()
  14. num_holder = droid.dialogGetResponse().result
  15. droid.removeDialog()
  16.  
  17. print num_holder
  18.  
  19. numberOfPlayers = int(num_holder["value"])
  20. '''
  21.  
  22. turns = 0
  23.  
  24. numberOfPlayers = int(droid.dialogGetInput("Number of Players", "Please enter the number of players: ").result)
  25.  
  26. thisBattle = Battle(numberOfPlayers)
  27.  
  28. thisBattle.createHTMLTimeline()
  29.  
  30. while 1:
  31.    
  32.    
  33.     path = urlPath + "/html/mainScreen.html"
  34.     droid.webViewShow(path)    
  35.     result = droid.eventWaitFor('select').result
  36.        
  37.     select = result['data']
  38.        
  39.     if select == "add":
  40.         thisBattle.addPlayer()
  41.        
  42.    
  43.     elif select == "edit":
  44.         print "EDIT PLAYERS"
  45.    
  46.     elif select == "delete":
  47.         print "DELETE: NOT IMPLEMENTED"
  48.    
  49.     elif select == "advance":
  50.         print "ADVANCING"
  51.         thisBattle.tick()
  52.    
  53.     turns = turns + 1
  54.     print "TURN:" turns
  55.     thisBattle.updateTimeline()
  56.     thisBattle.createHTMLTimeline()
  57.    
  58.    
  59.  
clone this paste RAW Paste Data