To redraw the surfaceview to move to the next level
I have class Maingamepannel
extending surfaceview
for my games first level everything works fine. Now i Want to redraw my surfaceview
for my next level so that I can reinitialize my
bitmap objects at their initial position and start the game again with bit diffrent conditions
which i have handeled in switch case.
To achieve this after finishing my annimations in first loop I have called my activity showing view again like this---
Intent backIntent = new Intent(getContext(),mygame.pkg.StartGame.class);
sg.level++;
backIntent.putExtra("levelkey",""+sg.level);
getContext().startActivity(backIntent);
By doing this I am able to redraw my bitmaps at initial position and starting annimations again, But the problem is this is d开发者_如何学Pythonrawing a another surface while my requirement is to use the same surface or delete the first surface and then drawing a another one.
To moving to the next level in game was easy task and i achieved it by just level counter and simple switch case in Game loop
精彩评论