Notes
![]() ![]() Notes - notes.io |
public class Bebek {
public double can, enerji, agirlik;
public static double yas, tokluk, mutluluk, saglik;
public Bebek(double can, double agirlik, double enerji)
{
this.can = can;
this.agirlik = agirlik;
this.enerji = enerji;
yas = 1;
tokluk = 100;
mutluluk = 100;
saglik = 100;
}
public void oyunOyna()
{ //Enerji, Hayvanın Canı Kadar Düşecek
//Tokluk, Hayvanın Canı Kadar Düşecek
//Mutluluk Can Kadar Artacak
enerji -= can;
tokluk -= can;
mutluluk += can;
}
public void temizle()
{ //Mutluluk %30 Düşecek
//Sağlık %30 Artacak (100'ü Geçerse, 100 Olacak)
//Tokluk 10 Düşecek
mutluluk -= mutluluk * 0.3;
saglik += saglik * 0.3;
if (saglik >= 100) saglik = 100;
tokluk -= (tokluk * 0.1);
}
public void uyut()
{ //Sağlık 10 Artacak
//Tokluk 10 Düşecek
//Enerji 15 Artacak
saglik += 10;
tokluk -= 10;
enerji += 15;
}
public void besle()
{
tokluk += 20;
mutluluk += 10;
saglik += (saglik * 0.1);
}
public void hastalık()
{ //Mutluluk Yarıya İnecek
//Enerji Yarıya İnecek
//Tokluk Yarıya İnecek
//Sağlık yarıya İnecek
mutluluk -= (mutluluk/2);
enerji -= (enerji/2);
tokluk -= (tokluk/2);
saglik -= (saglik/2);
}
public void onDongu()
{ //Hayvanın Yaşı 1 Artacak
//Ağırlığı %10,
//Canı %5 Artacak
yas += 1;
agirlik += (agirlik * 0.1);
can += (can * 0.05);
}
public void showInfo()
{
System.out.printf("CAN : "+can+ "/ AGIRLIK : "+agirlik+"/ ENERJI : "+enerji+"/ YAS : "+yas+"/ TOKLUK: "+tokluk+"/ MUTLULUK : "+mutluluk+"/ SAGLIK : "+saglik);
}
public boolean isAlive()
{
return (can > 0 && agirlik > 0 && enerji > 0 && tokluk > 0 && mutluluk > 0 && saglik > 0);
}
}
![]() |
Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 14 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team