Yay, another coding video! 11:18 "I'm gonna copy the carrot code" Or, if you had it as a function, you could just call it... oh yeah, you did it later and even generalized it
A pumpkin takes 2 seconds to grow on dry ground. The pumpkin can die at any point during that 2 seconds. Watering the ground makes the pumpkin grow in 1 second which means the odds of dying are cut in half. A second pass over the grid using *get_entity_type()* will tell you if the pumpkin died in that square. If it did, replant it. If you then (loop) test that square until the pumpkin fully grows before moving on, when you reach the last square you will have a "mega pumpkin" the size of the grid.
I do something similar (coming up in the next video on Tuesday) but now I see I could probably optimize it a lot. I try to keep the code quite simple which can sometimes go against good optimization.
Do you mean how the currently executed lines get highlighted in the editor? Given that the language is custom (as other comments point out under this video) I would say the highlighting is custom as well (and dare I say easy to make since you 'parse' the commands yourself). I myself don't like because as the code execution speed increases, it just starts flashing very fast.
22:26 why dont u make sure it didnt plant any pumpkings before harvesting? You eould get the yield of the whole field ^3 Edit: there is a function for getting the plant in ur corrent tile Edit: theres no way im reading ur mind (28:00)
I'm still not quite sure why do you iterate over the world size instead of just going until you loop around move(North) if get_pos_y() == 0: move(East) Then you can just ignore the world size unless you really need it for something specific like a giant pumpkin check
because that is much worse than world size, you would need to use get_pos every iteration, what would mean about world_size² time wasted, in contrast to the world_size() function that would be called just one time
I wonder if the game has its own interpreter or if its actually a python interpreter behind the scenes... Maybe the Code is saved to a file somewhere? Then you could use a proper text editor...
Worst case I could copy&paste it into the in-game editor but where is the challenge in that, right? Imagine a video where I don't mess anything up. Unthinkable
The game says it's not Python, it's a custom language. As for using external editor/modifying filés directly, all scripts are in a save folder "import" statements are ignored.There is a setting for it to watch file changes. Use Python for Intellisense Edit: check the "External Editor" documentation entry for a better explanation and paths