start_game.rml 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <rml>
  2. <head>
  3. <title>Start Game</title>
  4. <link type="text/template" href="window.rml" />
  5. <style>
  6. body
  7. {
  8. width: 300px;
  9. height: 225px;
  10. margin: auto;
  11. }
  12. div#title_bar div#icon
  13. {
  14. icon-image-s: 230px 281px;
  15. icon-image-t: 152px 191px;
  16. }
  17. form div
  18. {
  19. width: 200px;
  20. margin: auto;
  21. }
  22. </style>
  23. <script>
  24. def SetupGame(event):
  25. import rocket
  26. if event.parameters['difficulty'] == "hard":
  27. game.SetDifficulty(game.difficulty.HARD)
  28. else:
  29. game.SetDifficulty(game.difficulty.EASY)
  30. (red, green, blue) = event.parameters['colour'].split(',')
  31. game.SetDefenderColour(rocket.Colourb(int(red), int(green), int(blue), 255))
  32. elem = LoadMenu('game').GetElementById('game')
  33. elem.Focus()
  34. </script>
  35. </head>
  36. <body template="pywindow">
  37. <form onsubmit="SetupGame(event)">
  38. <div>
  39. <p>
  40. Difficulty:<br />
  41. <input type="radio" name="difficulty" value="easy" checked="true" /> Easy<br />
  42. <input type="radio" name="difficulty" value="hard" /> Hard
  43. </p>
  44. <p>
  45. Colour:<br />
  46. <select name="colour">
  47. <option value="233,116,81">Burnt Sienna</option>
  48. <option value="127,255,0">Chartreuse</option>
  49. <option value="21,96,189">Denim</option>
  50. <option value="246,74,138">French Rose</option>
  51. <option value="255,0,255">Fuschia</option>
  52. <option value="218,165,32">Goldenrod</option>
  53. <option selected value="255,255,240">Ivory</option>
  54. </select>
  55. </p>
  56. </div>
  57. <input type="submit">Start Game!</input>
  58. </form>
  59. </body>
  60. </rml>