The Farmer Was Replaced

The Farmer Was Replaced

Is there no way to make global variables, also what about a inbuilt wait function?
The problem I had was changing map size I don't want to change the map size throughout my function, which is fine I made a function to automaticly find mapsize so I don't have to do anything, but still good idea to be able to make global variables, also can we get a built in wait function would be nice, as the game progresses it seems like it'll become obsoletee due to how the size of the plot square in size vs how the speed is linear, and I'll just add some int to the get.time function and use a while loop to make a wait function that way
< >
Menampilkan 1-5 dari 5 komentar
The OG Gear 10 Mar 2023 @ 10:11pm 
get_world_size()
will let you get the size of the map from anywhere without creating your own function. Finding the x and y coordinates manually for the maximum map size is quite a bit slower. Note that this function returns a single value, after the initial couple expansions the map is always a square as far as I'm aware so this single value is acceptable.

As for globals, the game definitely doesn't do them currently from what I can tell. Every function is an individual unit. I'd recommend passing minimal data around with function arguments if there's something you actually need a global variable for. This is a surprisingly rare case, though.
Belagore 11 Mar 2023 @ 5:05am 
lol i made a function like this

def resetPos():
for i in range(get_pos_x()):
move(West)
for i in range(get_pos_y()):
move(South)

def getMapSize():
resetPos()
move(South)
move(West)
size = get_pos_x()+1
move(North)
move(East)
return size
then I just pass it through the functions, but get_world_size() would work nicely too now, also I would love an in game library where i can get built in functions rather than going through the unlock info menu I wash i could show you everything I've done up too now
Belagore 11 Mar 2023 @ 5:07am 
it didn't do the indents but whatever
Rolar8 11 Mar 2023 @ 9:12pm 
At the moment the game is a cross between an idler and a puzzle - and if a problem can be solved with existing tools - why do we need new tools to solve it? They will only simplify the game that is pointless and make it just an idler. :)

Same with the timer. get_time() is enough.

It is not clear how function get_world_size() could not be seen. She goes with "for"

If not a secret - why do you need a global variable?
Me - to get through Maze - without unnecessary poking at the walls :)
Terakhir diedit oleh Rolar8; 11 Mar 2023 @ 9:20pm
Aztec 11 Mar 2023 @ 9:14pm 
You need to add [code]code[/code] like this

def resetPos(): for i in range(get_pos_x()): move(West) for i in range(get_pos_y()): move(South) def getMapSize(): resetPos() move(South) move(West) size = get_pos_x()+1 move(North) move(East) return size
< >
Menampilkan 1-5 dari 5 komentar
Per halaman: 1530 50

Tanggal Diposting: 10 Mar 2023 @ 8:55am
Postingan: 5