M
Mystic76
Guest
Straightforward problem.
In the game, you control a robot. You can place seeds on dirt tiles (they are always perfectly on the tile) and you can press spacebar to water the seeds to grow into a new plant. For some reason, only one plant gets spawned and you have to wait for the timer to end (yes i made a timer) for the plant to become visible and for the seeds to be destroyed. You cannot create another plant while another one is on the timer for some reason! You can also only water the plants in the order you placed the seeds. I'll post more details if asked, this post is rushed. Please explain what's wrong.
In the game, you control a robot. You can place seeds on dirt tiles (they are always perfectly on the tile) and you can press spacebar to water the seeds to grow into a new plant. For some reason, only one plant gets spawned and you have to wait for the timer to end (yes i made a timer) for the plant to become visible and for the seeds to be destroyed. You cannot create another plant while another one is on the timer for some reason! You can also only water the plants in the order you placed the seeds. I'll post more details if asked, this post is rushed. Please explain what's wrong.
Code:
sprite_index=spr_dirt
if instance_exists(obj_waterseed) water=position_meeting(obj_waterseed.x,obj_waterseed.y,self)
if instance_exists(obj_earthseed) earth=position_meeting(obj_earthseed.x,obj_earthseed.y,self)
if position_meeting(obj_robo.x,obj_robo.y+32,self) {
if keyboard_check_pressed(vk_space) && global.inventoryup=false {
if earth && water {
instance_create(x+32,y+32,obj_mud)
}
}
sprite_index=spr_farmland
}