0
Android java
idk im new still learning java but i dont have a laptop yet so i decided to make an app to get money for the laptop app" deal or no deal game " i found the codes on internet but idk how to make it an app rn need some help please ty all
4 Answers
0
"[...]i found the codes on internet[...]"
So you didn't even program the game yourself?
0
told im still learning java its my first days mate
0
Then you should start with something smaller, not an app. Everything that involves Graphics and UIs is advanced, and it would help a lot more if you would start with something easier first.
Also a bad app will cost you more than it will earn you.
0
its an easy not unity or graphics ..... its just an array list
The Game Class
import java.util.List;
import java.util.Arrays;
import java.util.Collections;
public class Game {
private Case[] cases = new Case[26];
private Player player = new Player();
private Banker banker = new Banker();
private int myAmount = 0;
private int turn = 1;
private int briefCases = 26;
private int casesToRemove = 6;
private int offer = 0;
private boolean gameContinue = true;
public void caseSetup() {
List<Integer> values = Arrays.asList(1, 5, 10, 100, 500, 750, 1000, 20000, 50000, 75000, 95000,
100000, 150000, 250000, 350000, 400000, 450000, 500000, 600000, 700000, 25, 900000, 1000000, 1500000, 300, 900000);
Collections.shuffle(values);
for (int i = 0; i < cases.length; i++) {
int amount = values.get(i);
cases[i] = new Case(amount, i + 1);
}
}
public void showCase(){
for (int j = 0; j < cases.length; j++) {
System.out.print("\t[" + cases[j].getFace() + "] ");
if (j % 5 == 4) {
System.out.println();
}
}
}
public void game(){
caseSetup();
showCase();
myAmount = player.userCase(cases);
briefCases--;
while(gameContinue==true){
if(briefCases == 25||briefCases == 19 ||briefCases == 14 || briefCases == 10 ||briefCases == 7){
for(int counter = casesToRemove;counter>0;counter--){
player.removeCase(counter,cases);
briefCases--;
showCase();
}
offer = banker.getOffer(turn,cases,myAmount);
gameContinue = player.dnd();
casesToRemove--;
turn++;
}else if(briefCases == 1){
player.removeCase(1,cases);
offer = banker.getOffer(turn