This site requires JavaScript, please enable it in your browser!
Greenfoot back
76REINS
76REINS wrote ...

2023/2/28

I need help with my brick breakers game.

76REINS 76REINS

2023/2/28

#
I am currently trying to build a HP system that is located at the bottom right of the program. I don't want to hardcode the coordinates in and I am having trouble spacing the lifetokens(Orange Balls) apart from each other
private void prepareLives(){
        for(int i = 0; i<3; i++)
        {
            hpTokens[i] = new LifeToken();
            this.addObject(hpTokens[i],(this.getWidth()-25),(this.getHeight())-25);
        }
        //STEP 1 USE A LOOP TO ADD LIFETOKENS TO THE LIFETOKEN ARRAY
        //STEP 2 USE THE SAME LOOP TO ADD THE ITEMS FROM THE ARRAY TO THE GAME
    }
This is what I have so far. Thank you in advance and if any other information is needed I will provide
danpost danpost

2023/3/2

#
76REINS wrote...
I am having trouble spacing the lifetokens(Orange Balls) apart from each other
You may want to see my Value Display Tutorial scenario. It has a section on non-textual display of values and specifically touches on this type of visual counter.
You need to login to post a reply.