Advertising (This ad goes away for registered users. You can Login or Register)

Delete this

Programming on your favorite platform, for your favorite platform? Post here
Post Reply
jajasuperman
Posts: 1
Joined: Thu Aug 30, 2012 1:02 pm

Delete this

Post by jajasuperman » Sun Oct 28, 2012 9:20 pm

.
Advertising
Last edited by jajasuperman on Wed Oct 23, 2019 10:56 am, edited 2 times in total.

svenn
Posts: 66
Joined: Fri Dec 24, 2010 5:17 pm
Location: Belgium
Contact:

Re: Help with Python (Pygame)

Post by svenn » Thu Dec 20, 2012 2:48 pm

When the mouse coordinates hit the object, you should destroy it, and generate another object at random (x,y) position. To move an object and not draw on top of it, you should redraw the frame.

Code: Select all

while True :
if (check_for_collision(x, y)) :
redraw_screen();
generate_ball();
draw_ball(x,y);
collisions++;

if(collisions > 5)
exit;
Advertising

Post Reply

Return to “Programming”