I've spent the last few hours trying to figure out how to do this--been on multiple help sites, including these forums, trying to figure this out and at last I'm throwing in the towel and asking for help.
Here's what I want to do: I have several objects on the screen. I want the player to be able to click on any of these object and have it rotate 90 degrees, keeping that position until the player clicks again to rotate it another 90 degrees. The most obvious way to do this, as far as I can tell, is with an array of DynamicSprites and the DynamicSprite.Rotate command. The problem I'm running into is that I need the DynamicSprite array to be global, so that the effect of clicking an object can last until the player changes it again. I've tried several different ways to declare the DynamicSprite array outside the function, including in game_start, but when I try, inside the function, to change the values in the array, I'm told I can't assign initial values to a global variable.
I don't necessarily have to use DynamicSprites for this, but I'd like to as it seems like that would be the most efficient coding. The other way I know of to do this would be to have 4 different sprites (created from images I manually rotate myself) for each object, but there are 25 objects on the screen, and my plan is to have several different screens set up this same way. So while this method would avoid the frustrations of DynamicSprites, it would involve making literally hundreds of sprites and taking a very long time.
I'm really hoping there is a way to do this with DynamicSprites, to save me the hours of manipulating graphics. Can someone help me? Again, the goal is to have 25 objects on the screen, and every time the player clicks one, it rotates 90 degrees and stays that way until clicked again.
Here's what I want to do: I have several objects on the screen. I want the player to be able to click on any of these object and have it rotate 90 degrees, keeping that position until the player clicks again to rotate it another 90 degrees. The most obvious way to do this, as far as I can tell, is with an array of DynamicSprites and the DynamicSprite.Rotate command. The problem I'm running into is that I need the DynamicSprite array to be global, so that the effect of clicking an object can last until the player changes it again. I've tried several different ways to declare the DynamicSprite array outside the function, including in game_start, but when I try, inside the function, to change the values in the array, I'm told I can't assign initial values to a global variable.
I don't necessarily have to use DynamicSprites for this, but I'd like to as it seems like that would be the most efficient coding. The other way I know of to do this would be to have 4 different sprites (created from images I manually rotate myself) for each object, but there are 25 objects on the screen, and my plan is to have several different screens set up this same way. So while this method would avoid the frustrations of DynamicSprites, it would involve making literally hundreds of sprites and taking a very long time.
I'm really hoping there is a way to do this with DynamicSprites, to save me the hours of manipulating graphics. Can someone help me? Again, the goal is to have 25 objects on the screen, and every time the player clicks one, it rotates 90 degrees and stays that way until clicked again.