• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

warhammer 40k game(some bartender please move this to game forum)

 
Frank McDeffer
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, im making a very simple game based on the tabletop game Warhammer 40k
this is my first java project and im starting very simple, a basic menu and a bckground with moveable images, ill add functionality later, anyways, i have read most of java head on(great book by the way) and know how to display bitmaps and a gui, but i dont know anything much beyond that, so what i want to do is when the user clicks a button on the gui, when they move their mouse onto the playing area, the selcted bitmap jumps to the mouse and follows it around the playing area till the user clicks, if anyone could give me some sample code or even just explain it to me, that would be great!

__________________________________________________________________________
|!!!|
|!!!|
|!!!playing area!!!|
|!!!|
|!!!|
|!!!|
|!!!|
|!!!|
|!!!|
|!!!|
|!!!|
|_________________________________________________________________________|
|***************************GUI***********************************|
|_________________________________________________________________________|

sorry i just cant get this text representation to turn out right, it supposed to be a square playing area above a rectangular gui
[ August 24, 2007: Message edited by: Frank McDeffer ]
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"CPPguy,"

Please check your private messages by clicking on the "My Profile" link near the top of the page. Thanks!
 
Frank McDeffer
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry about that, anyways any reply would be greatly appreciated, and if you'd like more information on the game send me a private message, however i doubt if a very good version would be available soon, unlees the community REALLY comes through for me with answers
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for updating your display name!

I think this question would get more expert advice in our Swing/AWT forum. I'll move it there for you. (Follow link at the top of the page.)
 
Craig Wood
Ranch Hand
Posts: 1535
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are a lot of ways to put these kind of things together.
Here's an idea to help you get started.

edit: changed constructor name to properly match class name - sorry.
[ August 24, 2007: Message edited by: Craig Wood ]
 
Maneesh Godbole
Saloon Keeper
Posts: 10971
11
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you considered creating your own cursor from the bitmap? That approach would be easier as compared to the paint efforts involved in moving the bitmap.
Do take a look at Toolkit.createCustomCursor()
 
Frank McDeffer
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for the replies, and the game is sort of an rts game so i dont think custom cursors would work,and thanks for moving my post marc, definitely more help here.
 
Frank McDeffer
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thancks for the code craig, but im a little confused on how to implement it, heres the code i have so far,its just some very simple code for a gui and two images:

[ August 24, 2007: Message edited by: Frank McDeffer ]
 
Craig Wood
Ranch Hand
Posts: 1535
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Frank McDeffer
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you so much, you're a genious! it works just like i wanted. now i just need to figure out how to make it so that you can select which image you want to move!(also, if i could use this to choose who should shoot that would be great)
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic