Research portable Memory game | Исследовать портируемую игру Память
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

main-gui.py 3.2KB

5ヶ月前
4ヶ月前
4ヶ月前
4ヶ月前
4ヶ月前
4ヶ月前
4ヶ月前
5ヶ月前
4ヶ月前
4ヶ月前
4ヶ月前
4ヶ月前
5ヶ月前
5ヶ月前
4ヶ月前
4ヶ月前
5ヶ月前
4ヶ月前
5ヶ月前
4ヶ月前
4ヶ月前
4ヶ月前
4ヶ月前
4ヶ月前
4ヶ月前
4ヶ月前
4ヶ月前
4ヶ月前
4ヶ月前
4ヶ月前
5ヶ月前
4ヶ月前
4ヶ月前
4ヶ月前
4ヶ月前
5ヶ月前
4ヶ月前
4ヶ月前
4ヶ月前
4ヶ月前
5ヶ月前
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. import arcade
  2. from cli import *
  3. from cli_test import *
  4. from ctx import *
  5. from ctx_test2 import *
  6. from desktop import *
  7. from desktop_Platform import *
  8. from desktop_SequentialTimer import *
  9. from desktop_Window import *
  10. from gui import *
  11. from gui_aux_test import *
  12. from gui_test import *
  13. from llm_test import *
  14. from llm_test_Python import *
  15. from memory_test import *
  16. import sys
  17. print(ctx_test_Controller_executeFunctions_registerFunction_set())
  18. print(ctx_test_Controller_processQueue())
  19. print(ctx_test_Controller_registerFieldCallback_match())
  20. print(ctx_test_Controller_registerFieldCallback_mismatch())
  21. print(ctx_test_memoryContext_field())
  22. print(ctx_test_memoryContext_setField())
  23. print(llm_test_Python_copyByValue())
  24. print(llm_test_isDigit_digit())
  25. print(llm_test_isDigit_notDigit())
  26. print(llm_test_strToInt())
  27. print(memory_test_detectMismatchedItems())
  28. print(memory_test_detectMismatchedItems_itemTwice())
  29. print(memory_test_detectVictory())
  30. print(memory_test_generateConstPlayfield())
  31. print(memory_test_hideMatchingItems())
  32. print(memory_test_selectItem_1x())
  33. print(memory_test_selectItem_2x())
  34. print(memory_test_selectItem_3x())
  35. print(cli_test_exit_e())
  36. print(cli_test_exit_exit())
  37. print(cli_test_exit_victory())
  38. print(cli_test_exit_q())
  39. print(cli_test_exit_quit())
  40. print(cli_test_goOn())
  41. print(cli_test_greetUser())
  42. print(cli_test_showHelp_h())
  43. print(cli_test_showHelp_help())
  44. print(cli_test_selectItem())
  45. print(cli_test_promptSecondItemSelection())
  46. print(cli_test_reportMatchedItems())
  47. print(cli_test_reportMismatchedItems())
  48. print(cli_test_reportVictory())
  49. print(test_gui_aux_cellPositions())
  50. print(test_gui_generateTextureDescriptions())
  51. print(test_gui_generateTilePositions())
  52. ctrl = ctx_Controller(memory_createContext())
  53. ctrl.registerFunctions([
  54. # cli_exit,
  55. # cli_goOn,
  56. # cli_greetUser,
  57. # cli_promptSecondItemSelection,
  58. # cli_reportMatchedItems,
  59. # cli_reportMismatchedItems,
  60. # cli_reportVictory,
  61. # cli_selectItem,
  62. # cli_showHelp,
  63. gui_generateTextureDescriptions,
  64. gui_generateTilePositions,
  65. memory_detectMismatchedItems,
  66. memory_detectVictory,
  67. memory_generateConstPlayfield,
  68. memory_hideMatchingItems,
  69. memory_selectItem,
  70. ])
  71. def printDbg(c):
  72. print(f"Dbg key/value: '{c.recentField}'/'{c.field(c.recentField)}'")
  73. ctrl.registerCallback(printDbg)
  74. ctrl.registerFieldCallback("exit", lambda c: sys.exit(0))
  75. p = desktop_Platform()
  76. p.ctrl = ctrl
  77. p.sequentialTimer = desktop_SequentialTimer()
  78. p.sequentialTimer.callback = lambda key, value: ctrl.set(key, value)
  79. # Copy context to platform.
  80. # And process lots of functions that are interested in changes.
  81. def process(c):
  82. p.c = c
  83. desktop_displaySelectedTile(p)
  84. desktop_hideMatchingTiles(p)
  85. desktop_scheduleHidingOfMatchingTiles(p)
  86. ctrl.registerCallback(process)
  87. ctrl.set("didLaunch", True)
  88. ctrl.set("playfieldSize", 2)
  89. ctrl.set("cellSize", 25)
  90. ctrl.set("hideMatchingTilesDelay", 500)
  91. ctrl.set("tileImage", "res/tiles.png")
  92. ctrl.set("tileImageCount", 3)
  93. ctrl.set("tileImageHeight", 100)
  94. ctrl.set("tileImageWidth", 75)
  95. ctrl.set("windowWidth", 900)
  96. ctrl.set("windowHeight", 600)
  97. ctrl.set("windowAntialiasing", False)
  98. ctrl.set("windowBackgroundColor", "#ffffff")
  99. ctrl.set("windowTitle", "OGS Memory")
  100. desktop_loadTextures(p)
  101. desktop_createDeselectedTiles(p)
  102. desktop_createSelectedTiles(p)
  103. wnd = desktop_Window(p)
  104. arcade.run()