June 16th, 2013, 09:24 AM
Save value in a variable during movement
i have my game in which space rocket si constantly moving from one side to other...and if hits asteroid, explosion starts...and my rocket woud change its position....and lives that my rocket has is -1....and here is my problem....when my space rocket hits asteroid its coordinates are saved to variable explosion...when my space rocket change position,also the coordinates of explosion change....but i want to have explosion on exactly right spot where collision happened....is there any way that i can save value to exploston so the coordinates wont change??
iam doing it this way:
if explosion_save_value== True:
explosion_x = asteroid.rect.x
explosion_y = asteroid.rect.y
explosion_save_value = False
is there any better way to save this value
June 16th, 2013, 10:15 AM
You haven't really provided enough to diagnose the problem (also you should use code tags when posting). How long is your code? If it isn't too long then post it (in code tags).