@thermalshockone the normal Random method isn't really random since it will give the same numbers every time unless you use a diffferent seed each time
@WindowsErrorFixer Wow, this comment scared me! I mean, we're at the second series of Java (all in one about 90 episodes) and he needs helt to put a \n there?
Bucky you extremly good in this java thing, i really want to know if you can do a quick and urgent video on Client server side of java. My internet was down but im back on and im writing on this client server part of java on the coming monday 2011-10-31.
I would recommend you writing a book cause you present java in such a simple way.
@dtgonzalez1 I think you should work on your spelling first.
But if you've finished the beginner, intermediate, and game programming tutorials(and understand everything), you have a good amount of knowledge to keep going.
Bucky's videos are generally awesome but 2 videos on the threads are people who already knew it but wants to refresh their memories. The thread topic is a bit more deep and you have to study on it to have a grasp. Without that I wouldn't recomend you to push to game development
@bkbenemy Because when a computer generates random numbers, There not truely random There often very long algerithms that run based on current time (Very precise time), each compiler can compile its own alogorthim, Your one sucks XD
@bkbenemy oh sorry i didn't read what u said correctly, ignore my last one, because your computer will tell the threads to start in order, but they run similtaniously, So they will end at differn't times, but will most often start in order depending on your processor
All I get when I run it in chrome is "public class Danny { public static void main (String[] args) { Thread t1 = new Thread(new Apple ("one")); Thread t2 = new Thread(new Apple ("two")); Thread t3 = new Thread(new Apple ("three")); t1.start(); t2.start(); t3.start(); }
one thing if you don't understand java like me start with something basic like "Pascal" its easy to learn then "lite-C" Then "java" and ur done but I learned "Python" (programing language directed to games) java is directed to objects it creates multiple classes has you saw in the video if you were paying attention and you require a bit of skills and brain to understand what will happen when you compile the source code so have a nice day and good luck programing your own games :P
They actually don't run at the same time! I learned it in my Computer Architecture Classes, but we can say that They simulate to run at the same time! :D
Hehe, I remember making a chat program way back... Too bad I didn't know how to use threads back then, so if a client wanted to connect, the server would have to manually press the 'c' key to wait for a client to connect, since if the server was set to wait for a client, it wouldn't proceed until that was done, obviously... And then, also, the clients and the server had to 'refresh' the messages they got every so often manually=P
But wait what order do these execute in the main method? 1, 2, 3. So they also start at slightly different times. You just can sleep them and run them parallel right?
The time between each start() is so small that you can say they start at the same time. The "main thread" does not get locked by the run() method or execute any code there as this is the job of the new separate thread. So it goes immediately to the next start().
@xXZarlachXx Im in sort of same position as you...although u use this 'threads' thing because...wen u make monsters that walk about, u need to move them all at the same time...if u understand me?....so u have a timer for all ur monsters to move left nd right
wait wait wait... do you really thought it would be that easy? if you want to a simple game like a "pong", you need to learn lots of scripting.. and for a real game, tons of lots of scripting.. if you are new to java, you shouldnt watch these tutorials yet, try the "Java Programming Tutorials" from this guy (thenewboston), there are 87 videos teaching java..
You're probably trying to access a non-static variable from a static method. (public static void main()). So make the variable static or move out of the main method.
@cytt in eclipse you go to file then new project then put Apple or anything for project name then go to the little square icon below file then click class and call it Apple and the same for the Bucky class
public class Bucky { public static void main(String args[]) { Thread t1=new Thread(new Apple("one")); Thread t2=new Thread(new Apple("two")); Thread t3=new Thread(new Apple("three")); t1.start(); t2.start(); t3.start(); } } above is one class you have to copy exactly copy the capital letters java is case sensitive
Bucky is so fucking awesome. He could probably get a badass job with his skills but instead he teaches us all of this <33
LlDDSLl 1 week ago 5
You are the biggest boss ever!
Seracinfinity 1 week ago in playlist Java Game Development Tutorials
what kind of program do you use to write java?
rc2000123 3 weeks ago in playlist Java Game Development Tutorials
@rc2000123 eclipse, follow his beginner tuts
KillzyazMadness 3 weeks ago in playlist Java Game Development Tutorials
This has been flagged as spam show
i am not getting anything in the console at all just turns up blank
here are the files i have i didn't see any errors but maybe you can
(couldn't put in the com part but it needs to be there)
buck.java
pastebin. /k9TBzK70
apples.java
pastebin. /YwK75n1U
runemick 4 weeks ago
@runemick nvm mind i found that i put the " to soon in the printf
runemick 4 weeks ago
Comment removed
runemick 4 weeks ago
It always goes:
two is done sleeping.
one is done sleeping.
three is done sleeping.
for me.
Always in that order!
thermalshockone 1 month ago in playlist Java Game Development Tutorials
@thermalshockone the normal Random method isn't really random since it will give the same numbers every time unless you use a diffferent seed each time
xUlki99x 1 month ago
@steebai its called Eclipse and its very good I have it I love it its actually what notch used to make minecraft if you know who I'm talking about
USDAapprove 2 months ago
what program is he using
steebai 2 months ago in playlist Java Game Development Tutorials
@steebai go watch the first tutorials.
zinoonomiwo 2 months ago in playlist Java Game Development Tutorials
@steebai eclipse
CartoonGaz 1 month ago in playlist More videos from thenewboston
i had an error until i put private in front of the variable in the Apple class any thoughts on why?
bob39rocks 2 months ago
Multicore apps?
gudenaurock 2 months ago
WHO IS SLEEPING??? i don't understand a fck word of this video!!!!!! i'm gonna freak out
EgorAndIlias 2 months ago
Who put: time = r.nextInt(999999); like me?
SurgeDungeon 3 months ago 9
@SurgeDungeon :))
mastermindmusic01 1 month ago
Is it important to use less Threads? How many Threads uses big programms?
Genuigr 3 months ago in playlist Java Game Development Tutorials
have you been whatching the terminator movies, T1 T2 T3 lol
TheLandFerry 3 months ago
Mine says
one is sleeping for 300
two is sleeping for 597
three is sleeping for 36
three is doneone is donetwo is done <--- Have i done something wrong?
371Foreman 3 months ago
@371Foreman you haven't, it's just that all threads have a random number(time) assigned to sleep.
edgelit 3 months ago
@371Foreman You probably just forgot to add \n to the "%s is done\n"
PeacedDollar 3 months ago in playlist Java Game Development Tutorials
@371Foreman In your second class (with the run method) change "System.out.printf("%s is done", name);" to "System.out.printf("%s is done\n", name);"
WindowsErrorFixer 3 months ago
@WindowsErrorFixer Wow, this comment scared me! I mean, we're at the second series of Java (all in one about 90 episodes) and he needs helt to put a \n there?
Genuigr 2 months ago in playlist Java Game Development Tutorials
@371Foreman you forgot to ad the /n at 3:18
hackstuff123 2 months ago in playlist Java Game Development Tutorials
@hackstuff123 i put it in, but that was the output.
371Foreman 2 months ago
@371Foreman sorry i meant \n ... did you also put name after it
hackstuff123 2 months ago
Comment removed
UltraSpaceWalrus 4 months ago
Comment removed
pxpc2 4 months ago in playlist Java Game Development Tutorials
@UltraSpaceWalrus you don't know java and is watching java GAME development tutorials
pxpc2 4 months ago in playlist Java Game Development Tutorials
Bucky you extremly good in this java thing, i really want to know if you can do a quick and urgent video on Client server side of java. My internet was down but im back on and im writing on this client server part of java on the coming monday 2011-10-31.
I would recommend you writing a book cause you present java in such a simple way.
Thank you in advance
randallerasmus 4 months ago
why does my last line prints out like "three is donetwo is doneone is done" not every text in next line like his?
redzus 4 months ago
hey bucky i have all the code from tut 1 and 2 but when i click run it does nothing any help?
skinnyjeanius2011 4 months ago in playlist Java Game Development Tutorials
I used to use scratch, and I understand how the sleep command in these can be VERY usefull
Aaronster8 4 months ago
anyone know what IDE he is using?
TheSharkasmCrew 4 months ago
@TheSharkasmCrew Eclipse. I would recommend downloading the Java EE version from the downloads page.
falco659 4 months ago in playlist More videos from thenewboston
@falco659 thanks a lot man. also, lol out of all the people to reply a star fox fan does that's funny
TheSharkasmCrew 4 months ago
@TheSharkasmCrew Eclipse IDE for Java Developers
371Foreman 3 months ago
Threads does not speed up your program, but the GUI of your application.
FrostyGame 4 months ago
@FrostyGame threads don't really speed up anything per say, but allow multiple execution at once
c0decub 4 months ago
@flump999 if it wasnt just a simple mistake a really think you should go watch over his previous tutorials again, thats a bit to simple
OGZxBEEf 5 months ago
@xXZarlachXx What are you doing here? O.o
ryanjones56 5 months ago
this is "pretty much" an awesome series :P
hardyexe 5 months ago
@flump999 did you use an ampersand instead of the percent symbol?
AndroidDrummer 5 months ago
take a look at this java 2d game: /watch?v=7_sYPFesfzQ
awesomest first attempt @ creating a 2d java game!!!!
Cavemanbennett 5 months ago
@Cavemanbennett
I love how it's under your channel.
Also, nobody can find out if that's really a good java game because you didn't use a screen recorder...
SnowfireGames 5 months ago
This has been flagged as spam show
Mines is spelt exactly like that and everything is in the right place yet "Exception" is highlighted as an error. ARRRRRRRRRRRRRG
darkarlok 6 months ago
Comment removed
darkarlok 6 months ago
@flump999 that's probably because you've put & instead of % :L
darkarlok 6 months ago
I watched 80 begginer java tutorials from thenewboston do i no enuf to keep on goin with game devolopment?
dtgonzalez1 6 months ago
@dtgonzalez1 I think you should work on your spelling first.
But if you've finished the beginner, intermediate, and game programming tutorials(and understand everything), you have a good amount of knowledge to keep going.
MrArfyou 6 months ago
I love how the first one has like +120000 view and this one has +48,000views.
I image minecrafters faces went like this;
=D :D :) :] :| :[ :( >:C
Bollatic 6 months ago
@Bollatic not true im still going
giotheutuber 6 months ago 11
there are still errors in my apple.java
xXMinecraftboyXx 6 months ago
@xXMinecraftboyXx You did something wrong.
RASHTG 6 months ago
@xXMinecraftboyXx haha. Make sure you use run() instead of Run().
RASHTG 6 months ago
@xXMinecraftboyXx Also, make sure you use try & catch correctly.
RASHTG 6 months ago
When i run it nothing comes up in the console
THATBLU3GuY 6 months ago
For guys who does not know Threads yet:
Bucky's videos are generally awesome but 2 videos on the threads are people who already knew it but wants to refresh their memories. The thread topic is a bit more deep and you have to study on it to have a grasp. Without that I wouldn't recomend you to push to game development
TheDagohan 6 months ago
3 threads doesnt make your programm 3 times faster :-/
TheOneR4Y 6 months ago
one is sleeping for: 652
two is sleeping for: 484
three is sleeping for: 308
four is sleeping for: 463
My sleeping thread is always starting one two three four
Why ?
bkbenemy 7 months ago
@bkbenemy Because when a computer generates random numbers, There not truely random There often very long algerithms that run based on current time (Very precise time), each compiler can compile its own alogorthim, Your one sucks XD
Bananapoopman 7 months ago
@bkbenemy oh sorry i didn't read what u said correctly, ignore my last one, because your computer will tell the threads to start in order, but they run similtaniously, So they will end at differn't times, but will most often start in order depending on your processor
Bananapoopman 7 months ago
You should have saved three lines of code by calling start when instantiating your thread objects.
XaeroDegreaz 7 months ago
This has been flagged as spam show
@Pixeldy This isn't Commentary? ^^,
TheAwesomeDudeGuy 8 months ago
what was that application you runned ?
nafaka12 8 months ago
@nafaka12 I'm going to guess it's Eclipse, I'm using the same program...
itazurazukina 7 months ago
bucky please upload j2ee tutorials..
kishor1124 8 months ago
Are you Notch?
ilovehpwands 8 months ago
@ilovehpwands are you Obama?
RaverGames 8 months ago
@RaverGames pretty much
ilovehpwands 8 months ago
@ilovehpwands cool ^^
RaverGames 8 months ago
i fix the code java.util.random.*; should be java.util. otherwise you get an error. apparently my eclipse works differently than bucky's
warnexus 9 months ago
dont listen to these its fake!!!!!
TheTribet 9 months ago
All I get when I run it in chrome is "public class Danny { public static void main (String[] args) { Thread t1 = new Thread(new Apple ("one")); Thread t2 = new Thread(new Apple ("two")); Thread t3 = new Thread(new Apple ("three")); t1.start(); t2.start(); t3.start(); }
}
"
ignore the "'s.
554danny 9 months ago
one thing if you don't understand java like me start with something basic like "Pascal" its easy to learn then "lite-C" Then "java" and ur done but I learned "Python" (programing language directed to games) java is directed to objects it creates multiple classes has you saw in the video if you were paying attention and you require a bit of skills and brain to understand what will happen when you compile the source code so have a nice day and good luck programing your own games :P
Zarkahd 9 months ago
@TxDevenxT The file name isnt Apple then. It's saying that the class name doesn't match the file name... double check?
MakingGamesIsFun 9 months ago
@hotdog24449 Did you ever fix it i have this problem too
lukke18 9 months ago
Three-thousand seven-hundred seventyth!
skate2late 11 months ago
I like this vdo very much... Thank you very much for your support and it useful for me
chairattangthong 11 months ago
lol just started java like 3 days ago and feel like a pro.. thanks bucky!
vuvffufg 11 months ago 43
thanks bucky
tabishfuhrer 1 year ago
it is cooler to make the random 9999 instead of 999, u will see the messages pop up at different time.
hireshow 1 year ago
why was this uploaded to the intermediate tutorials too..?
TheGreekSkater 1 year ago
1. turn cc on
2. click transcribe sounds BETA
3. go to 6:33
4. LOL
RobloxmannenTV 1 year ago
@RobloxmannenTV but there isnt a 6:33
TheGreekSkater 1 year ago
@RobloxmannenTV do the same thing on 4:10
and then LOL
plutgamer 11 months ago
They actually don't run at the same time! I learned it in my Computer Architecture Classes, but we can say that They simulate to run at the same time! :D
guerrero006 1 year ago
@guerrero006 hey says it 3:55
theoneandonlyhut 1 year ago
@theoneandonlyhut :O sorry! hehehe XD
guerrero006 1 year ago
@guerrero006 they do on a multiple cpu/core machine. 1 thread per cpu/core
bandulu4real 1 year ago
i did this in java extend script.
didnt work at all, first line is already an error.
what program do you use?
and pls dont say Jcreator
k4rb0n3 1 year ago
@k4rb0n3 eclipse
theprogrammerteacher 1 year ago
Very interesting...
neoheadcrusher 1 year ago
Great tutorial. You should go over synchronized and a few other Multithreading Shared data and critical data.
- Great tuts
enviidakid 1 year ago
what's the (Exception E){}
wedklol 1 year ago
i love how well you explain things.
pbnjp 1 year ago
what do i need to make a java game... where can i download a installer pls reply thx =)
warsmith666 1 year ago
@warsmith666 go to his first tutorial on java programing.
not java game development.
L337wizard 1 year ago
First.
MyRsIrl 1 year ago
BUCKY TEACH US NIO :@! :D
eliteveteran 1 year ago
Ive used Gamemaker (dont know if anyone knows what it is) untill now.
It works in big the same as this but has much more limitations.
I even tried to make a really good 3d physics engien but got stopped by gamemakers limitations.
.
Ive now for some moths tried to use java but couldnt make anything close to what i could make in gamemaker.
After these tutorials everything became clear and i can continue to make games.
.
Thanks =D
hej100 1 year ago
Comment removed
Alexanderstuve 1 year ago
@Alexanderstuve yer man this class uses the apple one
xyzfbm 1 year ago
Great tutorial, thanks!
Hehe, I remember making a chat program way back... Too bad I didn't know how to use threads back then, so if a client wanted to connect, the server would have to manually press the 'c' key to wait for a client to connect, since if the server was set to wait for a client, it wouldn't proceed until that was done, obviously... And then, also, the clients and the server had to 'refresh' the messages they got every so often manually=P
mmKALLL 1 year ago
Is that like a skin or something on your notepad++? I have the newest one and mine looks the oldest lol :/
eFiii9 1 year ago
@eFiii9 He is using Eclipse.
morrowindwaytoomuch 1 year ago
But wait what order do these execute in the main method? 1, 2, 3. So they also start at slightly different times. You just can sleep them and run them parallel right?
t1.start();
t2.start();
t3.start();
cwieand 1 year ago
@cwieand
The time between each start() is so small that you can say they start at the same time. The "main thread" does not get locked by the run() method or execute any code there as this is the job of the new separate thread. So it goes immediately to the next start().
SirPayne 1 year ago
this is absolutely great
100Careless 1 year ago
Bucky, you are incredible. Keep it up!
31freebo 1 year ago
Bucky are you a raid leader? haha
pedromartinezzzify 1 year ago
Bucky = God [no more no less ;) ]
ravenwest09 1 year ago
commenting and rating. bucky ftw
bearhuntaa 1 year ago
Well done mate!
nilsi1987 1 year ago
thank you very much, greatly helpful
eetufck 1 year ago
three is done
two is done
one is done
FTW!
runescapesuckz 1 year ago
great job! :)
Ciniwittchen 1 year ago
run:
two is sleeping for 28052
four is sleeping for 60135
three is sleeping for 29314
one is sleeping for 31192
two is done
three is done
one is done
four is done
BUILD SUCCESSFUL (total time: 1 minute 0 seconds) :)
1deividas1 1 year ago
time = r.nextInt(999);
it's in line 10 in your Apple class.
2ivenhoe 1 year ago
i know :P
1deividas1 1 year ago
This comment has received too many negative votes show
lol... im new in java.. this is soo confising.. like... where is the game... this is just scripting.. what about figures, objects and so on lol
xXZarlachXx 2 years ago
@xXZarlachXx If youre new to java what are you doin here?....
You should probably learn java before starting to develop games.
Fjerdue 2 years ago 47
@xXZarlachXx Im in sort of same position as you...although u use this 'threads' thing because...wen u make monsters that walk about, u need to move them all at the same time...if u understand me?....so u have a timer for all ur monsters to move left nd right
HiGhDaRrEn 2 years ago
@HiGhDaRrEn You're correct. If you don't use a thread then everything is done one at a time.
TheTIprogrammer 1 year ago
Comment removed
tauamepacce 2 years ago
This has been flagged as spam show
@ xXZarlachXx
wait wait wait... do you really thought it would be that easy? if you want to a simple game like a "pong", you need to learn lots of scripting.. and for a real game, tons of lots of scripting.. if you are new to java, you shouldnt watch these tutorials yet, try the "Java Programming Tutorials" from this guy (thenewboston), there are 87 videos teaching java..
tauamepacce 2 years ago
@xXZarlachXx wow go watch the 80 or so tutorials
sumosumo84 1 year ago
@xXZarlachXx He's showing people HOW, dumbass.
trappingnoobs 1 year ago
OMFG! thanks, man. this is awesome!
ijnever 2 years ago
when i click run project it didn't say the same thing you have :(
n00bszpro 2 years ago
hey guys amazing tut! but can some one help me make a server use threads and create a new thread automaticly every time?
Ne00phyte 2 years ago
really thanxx alot i will watch all ur totoriails when i become free
hosh41 2 years ago
Why can't the threads be declared outside of a function in the Main class? I got an error saying it can't be referenced from a static context.
gamedevMike 2 years ago
You're probably trying to access a non-static variable from a static method. (public static void main()). So make the variable static or move out of the main method.
letsprogram 2 years ago
@letsprogram Thanks I've never used static methods before, but now I understand it.
gamedevMike 2 years ago
Comment removed
letsprogram 2 years ago
no problem :)
letsprogram 2 years ago
This is the best tutorial that I ever read on Java threads.
chinkitest 2 years ago
What did you click to run it? I used Notepad++
cytt 2 years ago
@cytt You have to use a program called Eclipse
WNAKAR 2 years ago
Where do I download it for Windows? Could you give me the link please? Thnx.
cytt 2 years ago
@cytt google eclipse downloads then
Eclipse IDE for Java Developers (92 MB)
bbnoctor 2 years ago
Notepad++ can't run a Java project,
you need a compiler to do it, and Notepad++
is a text editor... i use for scripting,
but you can only write programs with it
not run them.
Kenshin1666 2 years ago
@cytt in eclipse you go to file then new project then put Apple or anything for project name then go to the little square icon below file then click class and call it Apple and the same for the Bucky class
and in java everything is case sensitive
bbnoctor 2 years ago
the problem is with this code atm :
Thread t1 = new Thread(new Apple("one"));
Thread t2 = new Thread(new Apple("two"));
Thread t3 = new Thread(new Apple("three"));
sut9 2 years ago
problem message :
The constructor Thread(Apple) is undefined
The constructor Apple(String) is undefined
The constructor Thread(Apple) is undefined
The constructor Apple(String) is undefined
The constructor Thread(Apple) is undefined
The constructor Apple(String) is undefined
i have x6 of them problems please help so i can continue with these tutorials asap .
sut9 2 years ago
I think you didnt put word new before Apple like this:Thread t1=new Thread(new Apple("one"));
bbnoctor 2 years ago
i have the following problem message:
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
The constructor Thread(Apple) is undefined
The constructor Apple(String) is undefined
The constructor Thread(Apple) is undefined
The constructor Apple(String) is undefined
The constructor Thread(Apple) is undefined
The constructor Apple(String) is undefined
at Bucky.main(Bucky.java:5)
thats at trying to execute with problems the problem message said....(next comment)
sut9 2 years ago
bbnoctor 2 years ago
I have run out of character count
bbnoctor 2 years ago
When I run mine, the numbers are the same... not sure why.
PuddleOfMudd25 2 years ago
I have been waiting for your tutorials from a couple of months on this topic....thanks 5/5
saddamdon 2 years ago
god this is amazing :D :D :D
itsbrad212 2 years ago
I'll also add that the video won't start for me either...hm
yanos2soros 2 years ago
hey this video isnt working
ronny22 2 years ago
What is the problem? I'll try and help, I was getting a prob too but got it fixed ;)
DiabloKiller124 2 years ago
hey
it just doesnt load
this vdeo isnt working i referesh but nothing happens a skipp it nothing happens
the video will just not work they other ones do but not this one for some reason
ronny22 2 years ago
oh, i thought you meant something with the code :P
I'm not sure then, sorry
DiabloKiller124 2 years ago
aww
beforefajr 2 years ago
Nice, refreshes my java knowledge a bit. ;)
Keep up the good work.
rockYhre 2 years ago
Nice. Can't wait for the others
iceboarderz 2 years ago 4
面白い!
gasto5 2 years ago
eddaaa
Nexx892 2 years ago
This comment has received too many negative votes show
1st!
DiabloKiller124 2 years ago
troll
ExileBrothersOfRs 2 years ago
I fucking hate how people say "First!" Just shut the fuck up unless your posting a comment that inst useless.
TACOS11211 2 years ago 40
Rage much? I never do that, but I thought I would for once.
Why does it matter to you?
That comment you posted is useless too, btw...
DiabloKiller124 2 years ago
Rage? Thats not rage. Thats simply stating a point.
TACOS11211 2 years ago
Fuck you and stop saying first, dickshit. PERIOD
Mkalola 2 years ago
first
bbnoctor 2 years ago
@TACOS11211 LAST !!
Joking, I hate them too.
1deividas1 1 year ago