home Forumsplay_arrow Discussions play_arrow Gaming

1

First Ever Java "Game"

1 emeralds6 replies688 views
created 05/28/2015 7:55 am by TheGrimGamer14
last reply 05/29/2015 12:53 pm
So I decided to learn java, and this is my first project after a few tutorial videos.

Click to reveal
Posted by avatar
TheGrimGamer14
Level 1 : New Network
1

comment Login or register to post a reply.

6 replies

1
05/29/2015 12:53 pm
Level 40 : Master Mage
Pixel
thenubslayer2000
ThePixelPony
StackOverflow is a great place to learn.

You mean the first result that comes up when you google 'java how to x'


Yes, although the "How to" is unnecessary. You should be searching using this format: "<subject and sub-subjects> <problem in as few words as possible>". E.g. "minecraft java modding tutorial".
1
05/29/2015 12:34 pm
Level 45 : Master Button Pusher
LeeTheENTP
This makes me want to find out how to program on my calculator. I could make some neat programs on my Ti-83 Plus but this new Nspire CX is a bit more involved, it seems.
1
05/29/2015 12:26 pm
Level 21 : Expert Ninja
_benjimaestro
ThePixelPony
StackOverflow is a great place to learn.

You mean the first result that comes up when you google 'java how to x'
1
05/29/2015 11:17 am
Level 40 : Master Mage
Pixel
You've started learning Java; great!
I'll teach you some things.

"Access" modifiers:
public - Can be accessed from any class
private - Can only be accessed from inside the current class
protected - Can be accessed inside this class and any of its children (classes that extend it) and from inside the same package
nothing - Can be accessed from the same package (folder)

Other modifiers:
final - Once defined, it cannot be changed, use it when possible; it improves performance
static - There is only one of these in the class, try to avoid using this when you can
abstract - It exists but has to be defined by child classes, you won't need this for a while yet
transient - Uhh, you won't need this for ages so forget about it

When you have fields in a class (e.g. "Scanner scanner;") you usually want to make them private. It's good practise. When another class needs them, you create a method called getScanner() that returns the private Scanner object.

If you have any questions, feel free to PM!

http://stackoverflow.com/questions/2154 ... nd-private

StackOverflow is a great place to learn.
1
05/29/2015 11:10 am
Level 18 : Journeyman Warrior
serdarminecraft
RoboShadowHey! I've made that game on my calculator!



Me too!
1
05/28/2015 10:29 am
Level 29 : Expert Engineer
RoboShadow
Hey! I've made that game on my calculator!
But GJ OP, you're going places.

:C->0
:Disp "Minimum:"
:Prompt X
:Disp "Maximum:"
:Prompt Y
:randInt(X,Y)->A
:Lbl 1
:Disp "Guess"
:Prompt B
:If B>A:Disp "Guess too high":Pause:C+1->C:Goto 1
:If B<A:Disp "Guess too low":Pause:C+1->C:Goto 1
:If B=A:Disp "Correct!":C+1->C:Goto 2
:Lbl 2
:Disp "Number of guesses":Disp {C}

Planet Minecraft

Browse

Site

© 2010 - 2019
planetminecraft.com

Welcome