how would i make a cutscene at the end of my game that would, once done, would stop the game
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | private boolean notImage0 = false;private GifImage gif = new GifImage("cutscene.mp3");public CutScene extends World{ super(600, 400, 1); setImage(gif.getCurrentImage());}public void act(){ GreenfootImage img = gif.getCurrentImage(); if (img == gif.getImages().get(0)) == notImage0) // a change in image involving the first image has occurred { notImage0 = ! notImage0; if ( ! notImage0) { Greenfoot.stop(); return; } } setImage(img);} |