hi i want a this command to start after the 2 seconds from when the game starts
spawnTimer = (spawnTimer+1)%720; if (spawnTimer%60 == 0){ thisGame.Score++;}
spawnTimer = (spawnTimer+1)%720; if (spawnTimer%60 == 0){ thisGame.Score++;}
spawnTimer = (spawnTimer+1)%720; if (spawnTimer%60 == 0){ thisGame.Score++;}
import greenfoot.*; /** * Write a description of class bird here. * * @author (your name) * @version (a version number or a date) */ public class bird extends Actor { /** * Act - do whatever the bird wants to do. This method is called whenever *the 'Act' or 'Run' button gets pressed in the environment. */ flappyworld thisGame; private int spawnTimer; public void act() { jump_and_fall(); death(); s_core(); } void jump_and_fall(){ if(Greenfoot.isKeyDown("space")){ if (Greenfoot.isKeyDown("space"))setLocation(getX(), getY() -9); } setLocation(getX(), getY() +5); } void death(){ if(isAtEdge()){ this.getWorld().removeObject(this); } Actor bird = getOneIntersectingObject(bird.class); if(bird != null){ getWorld().removeObject(bird);} } void s_core(){ //i want the code bellow to start after 2 seconds spawnTimer = (spawnTimer+1)%720; if (spawnTimer%60 == 0){ thisGame.Score++;} } }
//i want the code bellow to start after 2 seconds spawnTimer = (spawnTimer+1)%720; if (spawnTimer%60 == 0){ thisGame.Score++;}
private int spawnTimer = -121;
if (spawnTimerr%60 == 50) thisGame.Score++;