Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import scala.util.Random
- object something {
- class Player(name: String) {
- }
- class Pokemon(name: String) {
- var hp = 100;
- var dmg = 0.5;
- var rand = new Random();
- def _attack(other: Pokemon) = {
- val dmg = (10 + rand.nextInt(16)) * dmg;
- other.hp -= dmg;
- println(s"$name has attacked $other.hp for $dmg");
- }
- def _heal() = {
- val healamnt = 10 + rand.nextInt(16);
- hp += healamnt;
- if (hp > 100) {
- hp = 100;
- }
- println(s"$name healed for $healamnt and is now $hp hp");
- }
- }
- class TallGrass() {
- def enter() = {
- }
- }
- def main(args: Array[String]) = {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement