Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Zylum's Worms - Java Style
Index -> Programming, Java -> Java Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
TheZsterBunny




PostPosted: Wed Jan 19, 2005 10:46 pm   Post subject: Zylum's Worms - Java Style

So, I'm trying.

It's going well, but I've hit problems with corners. And worms sticking to the Y0 border.

They get trapped.

Its being done in an applet window. For the time being, drag your mouse around to move 'em.

Any Ideas on where I went wrong?

-Z

p.s. They say the most sincere form of flattery is imitation...

--edit--
Ok. Here

-Z



WormMain.java
 Description:

Download
 Filename:  WormMain.java
 Filesize:  1.21 KB
 Downloaded:  198 Time(s)


WormClass.java
 Description:

Download
 Filename:  WormClass.java
 Filesize:  2.27 KB
 Downloaded:  191 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
Hikaru79




PostPosted: Wed Jan 19, 2005 11:04 pm   Post subject: (No subject)

Zster... this is an applet... perhaps embedding this into an HTML file, and linking it would be ideal for those of us too lazy to start compiling? Wink Ask me over MSN if you need hosting. http://thegoban.com is always open to you, my friend Smile
zylum




PostPosted: Wed Jan 19, 2005 11:16 pm   Post subject: (No subject)

i didnt take a look at your code but it seems that you are initializing the _y to 0 and that your not changing the angle properly... also, it only works when you keep the mouse button down and moving. is that intentional?

good job so far, the colors are working and look nice and you seem to have gotten the movement of the cricles right Wink
TheZsterBunny




PostPosted: Thu Jan 20, 2005 12:37 am   Post subject: (No subject)

H79, thank you for the offer, but I also have web hosting, I was too lazy to host it ^_^.

Besides I wanted to show the code. Thats the issue here.

I'm looking at the code, and I can't find where i'm setting the Y value to be 0.

I modified the code slightly:

-Added more color possibilities
-Converted from degrees to radians
-Added the ability to limit (rectangularly) the worm boundaries.

-Z

p.s. Yes, the mouseDrag repaint was intentional, Applets are a new thing to me, and I've yet to find a way to draw nicely without lagging out my comp. (feel free to help at any time hikaru)

-Z[/i]
Hikaru79




PostPosted: Thu Jan 20, 2005 11:52 am   Post subject: (No subject)

Here it is, for folks too lazy to compile it themselves: http://thegoban.com/worms/worm.html . ZBunny, you should edit your first post with this URL.
Display posts from previous:   
   Index -> Programming, Java -> Java Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 5 Posts ]
Jump to:   


Style:  
Search: