mirror of
https://github.com/Cpt-Adok/SNAKE.git
synced 2026-03-28 17:13:43 +00:00
changement de dossiers
This commit is contained in:
26
src/Environnements/Fruits.java
Normal file
26
src/Environnements/Fruits.java
Normal file
@@ -0,0 +1,26 @@
|
||||
package Environnements;
|
||||
|
||||
import Item.Effects;
|
||||
import Item.Items;
|
||||
import java.util.Random;
|
||||
|
||||
public class Fruits{
|
||||
String typeFruit;
|
||||
Effects bonus;
|
||||
|
||||
public Fruits(){
|
||||
Random r=new Random();
|
||||
Items [] fruits=new Items[] {Items.BANANE,Items.FRAISE,Items.ORANGE};
|
||||
int q=r.nextInt(3);
|
||||
this.typeFruit=fruits[q].getName();
|
||||
this.bonus=fruits[q].getEffects();
|
||||
}
|
||||
|
||||
public void getFruit(){
|
||||
System.out.println(this.typeFruit);
|
||||
}
|
||||
|
||||
public void getBonus(){
|
||||
System.out.println(this.bonus);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user