1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2013
    Rep Power

    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
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Rep Power
    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).


IMN logo majestic logo threadwatch logo seochat tools logo