Karl Nilsson

Greenhorn
+ Follow
since Jan 06, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Karl Nilsson

it's not too complicated, it's almost like using a sound file
here's an example:

20 years ago
now i'm trying to make the ship "float" instead of making sharp translations
to do this, im using 2 variables to hold the position of the final destination, and using the thread to move the ship a few twips per cycle until the ship is at its destination.
i will post again tommorrow when i have problems (and i know i will)
20 years ago
hey, got the thread to work!
now i just need to get enemy subs and a score and other stuff
ill post later, when i start experimenting!
20 years ago
this is kinda funny, because my school has the 1.4 JDK, and at the same time a nonworking IDE (Borland JBuilder), because my school has a bad network with people running it who don't understand it! This makes us code the long way
oh, if your school has other outdated IDE's, than that may be a point of interest, especially because (i think) schools get free software
so if your school had VB6, you may convince them to move to VB.net etc...
[ February 19, 2004: Message edited by: Karl Nilsson ]
20 years ago
i know java can embed c code, and c can embed assembler, but does that mean java can indirectly imbed assember? (just wondering, even though i can't imagine a practicle application for it)
20 years ago
hey, i need to know if there is a layout (other than in canvas) that allows the programmer to specify the placement of components by setting it a pair of coordinates
i know flowlayout is the default layout, and that doesn't do it
is a canvas my only option?
the reason i'm saying this is i started learning java a little while ago, but am still used to using VB and having no layouts, just coordinates
20 years ago
now, i have tried to make a thread to move the torpedo when the control key is pressed, but i am getting a crapload of errors
i think most of them are bacause the rectangles for the boundaries are declared private, but im not sure
here's the code so far:
20 years ago
ahh, so repaint() just calls the paint method over again! (Duh)
oh, by the way, have you ever tried making any games Nathan?
20 years ago
now the problem is with one line of code
the compiler won't let me make the bomb visible!
20 years ago
i tried to se if the rectangle was outside of the applet area, and after a few minutes, i somehow managed to get the image to appear!
and even better, it moves!
the only problem i see (only an inconvenience) is you have to click on the applet before you can move the ships
i don't know if this is fixable
now i am trying to be able to launcha torpedo
the first question i have is what is the keycode for the ctrl key is
also, i am having trouble making an array of invisible torpedoes that will appear whenever i push the control key
here's the code so far:

is there any way to just add an attachement to the post, because it gets annoying having to copy & paste all the time
[ February 09, 2004: Message edited by: Karl Nilsson ]
20 years ago
i got it to compile so far, but the image doesn't appear
this is a giant problem, but i know i am overlooking something
here's the code so far:
20 years ago
thank you!
i understand most of the code
but, i don't get this:

what does a media traker do
if i had to guess, i would say it has something to do with the image
also, could i use a timer instead of a thread for moving the subs & depth charges?
but if i had to use a thread, would i need one for each object?
as you can tell, im pretty new to java (and frustrated! )
[ February 05, 2004: Message edited by: Karl Nilsson ]
20 years ago
i understand most of the concepts, but i need examples of code!
heres my current source, if you want to point out any flaws, and where to put the threads, canvas, etc
20 years ago
hey, im trying to make an arcade subhunt game, but i have mastered only the basics of java (even though i know C++ & VB)
i know how to use the key event, but not how to move the image
also, how do you initialize a variable to contain the positions of the left, right, top,& bottom of the image?
20 years ago