Java-Gaming.org Java4K winners: [ by our judges | by the community ]         
Featured games (67)
games approved by the League of Dukes
Games in Showcase (∞)
games submitted by our members



News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  Print  
  A noob's project  (Read 2011 times)
0 Members and 1 Guest are viewing this topic.
Offline DudeJericho

JGO n00b
*

Posts: 5


窮すれば通ず


« on: 2011-04-03 06:50:33 »

Hello all, I know that despite being my first post I'm asking for something like this, but I figured I might as well cut to the chase.

I want to make a Kanji game, for those who don't know Kanji are Japanese characters that were borrowed from the Chinese many years ago, but enough about that, basically in this game I want to teach the user how to do the correct stroke order for each character.
I'll be completely honest, I suck at programming so this project is like a learn as I go along kind of thing. So I figured I would do something quite simple, I first show the user through images or something how to actually draw the character, then the user would have to match up certain dots or points (which would be then shown corrected by a line i.e. "stroke") in the correct order. If they match up the wrong points, then instead of say a green line (as in correct) it would be a red line and there would be a message or something at the side saying they messed up along with a redo button.
Anyway I think most of you get the idea, I would like to hear what you think of this and if any of you have any suggestions in terms of implementing since I'm finding it hard how to do so. I'm planning to create at least 10 kanji for this game, so my guess is that I need to create something that will let me use co-ordinates for the points on the window. I'm pretty sure I'll be using Paint quite a bit and mouseListener.
Any suggestions or advice (maybe things I should look up on?) would be greatly appreciated. Thanks.
Offline Kurten

Jr. Member
**

Posts: 75
Medals: 2


-w-


« Reply #1 on: 2011-04-03 07:18:05 »

Nice idea for a game, im afraid i can't help you program this game since it's a bit over my level, but i strongly like the idea!

//クルテン
Offline DudeJericho

JGO n00b
*

Posts: 5


窮すれば通ず


« Reply #2 on: 2011-04-03 13:43:28 »

Thanks for the encouragement クルテンさん Wink
Games published by our own members! Go get 'em!
Offline DudeJericho

JGO n00b
*

Posts: 5


窮すれば通ず


« Reply #3 on: 2011-04-05 17:51:49 »

Ok, after two whole days of research I have finally come across something, the MouseMotionListener interface, I believe I may be able to use this to be able to let a user draw on a panel using the mouse instead of that "points" idea which seems like could get abit messy and tricky, however I'm still not sure how I can use it for capturing the mouse cursor movement/location so for example if they started at a certain point and drew to another certain point that information would need to be captured and assesed seeing if they drew the correct stroke. Just writing this down makes it seem like it would be complicated Tongue
Any help/advice at all? Anyone? I'm not asking anyone to write anything for me, just want their opinions/ideas or areas they think I should look into..
Offline aazimon

Full Member
**

Posts: 208
Medals: 5



« Reply #4 on: 2011-04-05 23:00:46 »

Have your component that will be drawn on, be the listener of the MouseMotion. See the tutorial here http://download.oracle.com/javase/tutorial/uiswing/events/mousemotionlistener.html. In the mouseDragged method, the MouseEvent has the x and y coordinates, and simple use those to draw on the screen.
Offline DudeJericho

JGO n00b
*

Posts: 5


窮すれば通ず


« Reply #5 on: 2011-04-08 19:07:44 »

Thanks for the reply.
Drawing on the window is not the problem really, its somehow having each character assigned certain co-ordinates that the user needs to cover to do the correct stroke, like it would be an array or co-ordinates for one stroke and if the co-ordinates of that array how been looped through meaning the user has dragged the mouse over them, then another array of co-ordinates would be available for them to draw over, but I don't think that will work. This is quite a hard program for me to do (especially as a newbie) which is why I'm trying to brainstorm abit here..
Offline philfrei

Sr. Member
**

Posts: 492
Medals: 24



« Reply #6 on: 2011-04-08 20:16:39 »

OK, here is an idea.

Suppose you broke up the area to be covered into component polygons. The line that is drawn can be tested against the array of polygons, using a polygon's "contains" function. The draw act is successful if:

1) the mouse's location proceeds through all the polygons, in correct order;
2) the mouse's location never goes outside of any of the polygons, or (alternatively, if the polygon array is not perfectly contiguous) if it does not stray into a border(offlimits) polygon.

"Life is short, art long, opportunity fleeting, experience treacherous, judgment difficult." Smiley
Offline DudeJericho

JGO n00b
*

Posts: 5


窮すれば通ず


« Reply #7 on: 2011-04-09 02:36:10 »

That sounds good! I'll mess around with that abit. Thank you!  Smiley
Pages: [1]
  Print  
 
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.113 seconds with 20 queries.