by skydereign » Thu Feb 23, 2012 12:58 am
When people provide code for you the first thing to do is understand what it is doing. You'll find that you can figure out why it doesn't work pretty easily. In your case you know exactly what it is doing wrong, and theoretically you can fix it because you understand what it isn't doing. We can't know everything in your games, so we tend to provide code that gets the general idea across, and you as the programmer can apply it to your game. In this case SuperSonic's code doesn't work to what you want because you want the view to move when the particles all disappear (and lives is 0). I happened to see your game so I knew what you needed and if you look it takes into account the problem you had.
The code belongs in the particles destroy actor event, and therefore will only trigger if the particle is being destroyed. But, we don't want it to move the view if there are still particles or if the player still has lives left. That's why it checks if lives is equal to 0, and if so continues to check if there is only one particle left. If that is the case it moves the view to some position (which would be where you want the view to move to display the hiscores). Another thing you'll need to do is set the view's xvelocity to 0.