Help with happiness meter?

helpwithcodee

#1

Okay, since tagging CodeHelp on my gt about this was really ineffective (everyone just read and liked the post), I’m making a topic about this.

So I’m making this project, and there’s going to be a happiness meter that looks like this:

Happiness: ##

Oh yeah, and it’s a project where you’re taking care of a bird. So when the bird is improperly cared for or unhappy — not fed exactly once (not zero times, not twice) a day, not petted (still gotta add that), etc. — the happiness meter (btw there’s one meter for both birds unless there needs to be two) goes down or doesn’t increase.

So basically I need help with how to tell when this stuff doesn’t get done, and to tell the meter to go down. And putting multiple factors of happiness into the decreasing.

This is probably going to be useless, but @codehelp.


#2

So, make your variable
When the food is tapped, or the hand, etc. Is tapped, increase your variable


If your variable doesn’t equal blank, then set your happiness meter lower, and vice versa


#3

Tysm, I’ll add that!
I’ll give credit too : )


#4

You don’t have too!
Actually, ofc it’s your choice, but I prefer not to have credit!
IkR who says that these days?


#5

Have the text set to the variable. Have another variable maybe so it can see if the happiness hasn’t increased for a certain amount of time?
I’m not entirely sure on most of that, so maybe @CoderOfMagic or someone can help with this


#6

Oof I have no idea… I don’t think you should randomize it, that was an idea


#7

Fearless just whipped this up for you really fast.
The code is really straight forward, but here’s this anyway:

They said that you could add a block where the bird started with a certain level of happiness of you wanted.
You can also use the same side in different starting blocks (like you’d have the happiness increase by a certain amount when the bird is fed)

If you have any questions/need anything else’s, you can remix the project and they’ll answer or you can tag me and I’ll try to help

@tankt2016


#8

Why not post a link of the project?


#9

@A_Metalhead @MewtwoCreator @CoderOfMagic tysm!!
Also @hopscotcher whoops forgot that :grimacing:
It’s the most recent project on my profile though
https://c.gethopscotch.com/p/zytf4vsma


#10

What CoM said should work. It’s all about the conditionals and variables. I’m thinking you would need at least 2 variables (one for the happiness and one for the feeding). The happiness would be dependent on both the feeding variable and when the hand bumps (or is touching) the bird. Or if you just tap the hand to pet the bird, you could use when tapped and when not tapped (the latter using some wait blocks and an increase by negative on your happiness variable.

I’m sure Fearless’s thing works great too. I haven’t looked at it though


#11

You actually wouldnt necessarily need two variables. The happiness one on its own would be fine.
You’d just need to add in a “when (FOOD BOWL) is pressed, increase value (HAPPINESS) by 1”


#12

I know. But she doesn’t want the bird fed more than once a day.


#13

Ahh okay yeah, then she’d have a food variable.

(Originally what I meant by that was that you’d only need to create one new variable just for the happiness, but it’s not really important) Bye gtg Fea wants their iPad back cya later


#14

Well I might skip that and make the day/night thing insignificant