We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I am trying to get a bomb to drop and when it hits the ground, it brings up an image of an explosion - the bomb resets and drops again.
NEXT I want a new random location for the bomb. I don't know where I am going wrong. I am trying to make this more efficient by using function for each thing that I am doing. I am sure there is something major wrong here, but I just can't make heads of tails of it right now . I don't know how to attach the two images.
I also had to make up my own TIME DELAY because I can't figure out how to do it.
start_drop=0 def setup(): global img, img2, random_start_x size(400, 400) background(255) # white img=loadImage("bombsmall.jpg") img2=loadImage("explosion.jpg") random_start_x=int(random(1,400)) def draw(): global img, img2 random_start() def random_start(): random_start_x=int(random(1,400)) print("This is the new start on x ", random_start_x) bomb() def bomb(): global start_drop, img, img2, random_start_x background(255) image(img, random_start_x, start_drop) start_drop=start_drop+5 if start_drop>360: c=0 while c<1000: explosion() print(c) c=c+1 start_drop=0 random_start() def explosion(): global img2 print("test") img2=loadImage("explosion.jpg") image(img2, random_start_x, 100)