A little late this week due to tests, but:
SUCCESS!!! I refocused by drawing a visual logic diagram for what the embedding is supposed to do. This helped me figure out what to not look at when reading the Python C API documentation.
After three weeks, speaking through the API documentation with Mark, Adam, and posting a question on stack overflow, I have finally figured out embedded Python! The C Python API call PyRun_InteractiveLoop function. This creates a Python Console line, which I can now work with and embed into my API.
As it is currently listed, it takes console command arguments with stdin and "<stdin>" for the embedding. I theorize, but am uncertain, whether changing the variable names will allow me to pass the data from the game portion to the Python interpreter and back.
The next step on the back end now that the embedding portion is done, figure out how to transfer the data from Python Interactive back into C/C++.
Front End:
Not a whole lot of progress since initial proof of concept. I am still leaning heavily towards SFML as my API, but I might switch to Vulkan or OpenGL to learn a new one and challenge myself. Vulkan and OpenGL are more robust API libraries with a lower level connection to the hardware. I think it's unnecessary for my needs, but never a bad thing to pick up. Vulkan and OpenGL being in C over C++ means the entire program could be in C if I went that route, not that C and C++ are incompatible as it is.
Puzzles:
With the embedded console, now comes Puzzle Design. The three big types:
Basic Input/Output. This is the early stuff. "Hello world" and Mad Libs. I am wondering whether the "helper tutorial" character could have a sibling that would "say" whatever the user puts in through a speech bubble.
Interacting with variables. Things like making a calculator for the circumference and area of a circle. Python with OpenGL or Vulkan underneath should be able to draw circles with those areas, assuming they're also in the screen size.
Basic conditional statements. Things like "if" "else (if)" "while" "do while": I am thinking of using basic movement for the "helper character's sibling" as a way to teach this; especially for the youngest audience target.
To learn:
SAVE STATES! Being forced to redo the puzzles every time a user starts up a game will get cumbersome.
No comments:
Post a Comment