Here is console version: import java.util.Random; import java.util.Scanner; public class JumpGame { private static final Random random = new Random(); private static final Scanner sc = new Scanner(System.in); public static void main(String[] args) { String input; int life = 10; int goal = 10; int glass; while(goal > 0 || life > 0){ // input = player(); input = ai(); glass = rand(); if(input.equals("left") && glass == 0){ goal--; display(life,goal); } else if(input.equals("right") && glass == 1){ goal--; display(life,goal); } else { life--; display(life,goal); } } } private static void display(int life, int goal){ if(life == 0 || goal == 0){ System.out.println("Game end!"); System.out.println("People left: " + life); System.out.println("Moves left: " + goal); System.exit(0); } else { System.out.println("People left: " + life); System.out.println("Moves left: " + goal); } } private static int rand(){ return random.nextInt(2); } // Player private static String player(){ return sc.next(); } // AI bot private static String ai(){ String direction; int AIMove = rand(); if(AIMove == 0){ direction = "left"; } else { direction = "right"; } return direction; } }
@ThaRoboForm3 жыл бұрын
Good instructions. It's easy to follow. Awesome
@the7avadabetheme4403 жыл бұрын
i love your channel,Great video! Thank you
@hubcreek69573 жыл бұрын
Super good... Subscribed. Thanks
@milaazul7123 жыл бұрын
I liked it so much.... thank you
@delaaprilianti30892 жыл бұрын
hello i have followed it correctly, but my jbutton play again is not working please help
@folaadtv99433 жыл бұрын
omg😇 awesome work
@yosepsetiawan75982 жыл бұрын
can you help me to send the source code
@jhonreybalbastro45352 жыл бұрын
Hi Sir. Good day! I'm a Computer Science student and I have one project to submit to my professor. The project is to make or create a simple game. So, I already found your game and I really like it but my problem is I can't get the source code of it. Can I request to get the source code of your nice game? Thank you so much sir. I'm looking forward to hear from you.
@amnaarshad18922 жыл бұрын
where do i find the images which is used in this game?
@1BestCsharpblog2 жыл бұрын
from pixabay
@amnaarshad18922 жыл бұрын
It was a great video but my play again button is not working i’ll be very great full if you can help me.
@impekatemplates28493 жыл бұрын
Wow i love it
@norauretemplates25703 жыл бұрын
Jesus!!!!! Love it
@yosepsetiawan75982 жыл бұрын
can you help me to send the source code
@e-series59613 жыл бұрын
13
@mohamedzoghpy76823 жыл бұрын
brllant
@jhonreybalbastro45352 жыл бұрын
Hi sir, I already done following your video but it seems the jLabels (Tiles doesn't have footprint when I clicked it.) I already send you a message in your Instagram account and I already followed you there. Also, I already subscribed to your KZbin channel. Please help me sir. Thank you so much.
@jhonreybalbastro45352 жыл бұрын
Hi Sir. Good day! I'm a Computer Science student and I have one project to submit to my professor. The project is to make or create a simple game. So, I already found your game and I really like it but my problem is I can't get the source code of it. Can I request to get the source code of your nice game? Thank you so much sir. I'm looking forward to hear from you.
@1BestCsharpblog2 жыл бұрын
source code link in the video description
@jhonreybalbastro45352 жыл бұрын
@@1BestCsharpblog Can you help me sir because I already created and design it using JFRAME not NetBeans. We are using JFrame to design and Jcreator to edit the code of it. Honestly, I'm not smart in coding sir because I'm new and I'm still learning. I hope you can able to help me this time sir. Thank you very much. :)
@jhonreybalbastro45352 жыл бұрын
Can you help me sir because I already created and design it using JFRAME not NetBeans. We are using JFrame to design and Jcreator to edit the code of it. Honestly, I'm not smart in coding sir because I'm new and I'm still learning. I hope you can able to help me this time sir. Thank you very much. :)
@jhonreybalbastro45352 жыл бұрын
Sir can you please help on my project. I’ll just need to pass my subject.😢
@jhonreybalbastro45352 жыл бұрын
Hi sir, I already done following your video but it seems the jLabels (Tiles doesn't have footprint when I clicked it.) I already send you a message in your Instagram account and I already followed you there. Also, I already subscribed to your KZbin channel. Please help me sir. Thank you so much.