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

2022/1/12

trying to make a rythm game like fnf, how could I do that?

marvin1 marvin1

2022/1/12

#
hello I am currently attempting to make a rythm game sort of like fnf otherwise known as friday night funking but so far I have not figured out any kind of code to do this, so I hope you can help me with some code you think could work, many thanks
Dinklberg Dinklberg

2022/1/12

#
beep boop. (this is a joke we are firends)
Spock47 Spock47

2022/1/12

#
The first step should be to think about which parts of the game you actually want to implement. A good way to do this is to describe the game you want to implement here for someone that does not know fnf. That way 1. you basically will have a to-do list of parts ("functionalities") you will have to implement and 2. the other people here will have a better understanding of how to help you create what you expect. Live long and prosper, Spock47
marvin1 marvin1

2022/1/12

#
ah right so basically for those who do not know fnf its basically where you play as a person on the right side as well as a character being on the left side in which arrows will slowly move up to faded out arrows which then they will dissapear and then you must do the same as the bot done but depending on when you press the arrows you will get either a great good or a bad if its great u gain points if you get good you get very little points but if you miss you lose points, there is also a health bar system in which if you miss you lose health but hitting notes correctly gets you more health if you run out of health you die, I need help with all of these especially the system of the arrows all coming up at different times and dissapearing. many thanks (also thanks spock)
danpost danpost

2022/1/12

#
I will presume ALL arrows will go up at the same rate of speed, relatively (that is, the rate may increase as the game progresses; but, each arrow will have a constant speed that is relatively the same as those near it). Also, they will all fade and disappear at the same heights when going up. With that said, all arrows will use the same general code for moving and fading (only possible difference will be speed over time). So, the only variable needed is a field for the speed. With variable speed, a smooth moving system might be in order (so change can be continuous and not abrupt). Your game world should control the random (in time) spawning of arrows. It should also control the speed that is set to any arrow spawned. Proceed to code as suggested. If any issues, show code and express concerns.
danpost danpost

2022/1/12

#
Another suggestion would be to override the removeObject method of the World class in your game world. With that, you can detect arrows being removed, determine at what height they are removed and adjust a score field in your game world appropriately, before actually removing the actor (by calling the overridden method -- using "super.removeObject(obj);"). It might look like this (for example):
public void removeObject(Actor obj)
{
    if (obj instanceof Arrow))
    {
        if (obj.getY() > 300) addScore(20);
        else if (obj.getY() > 200) addScore(10);
        else if (obj.getY() < 100) addScore(-40);
    }
    super.removeObject(obj);
}
marvin1 marvin1

2022/1/14

#
ah alright I will try make some code with this example and then come back to say if it worked just to keep updated
You need to login to post a reply.