A noob's project

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.

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!

//クルテン

Thanks for the encouragement クルテンさん :wink:

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 :stuck_out_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…

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.

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…

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.

That sounds good! I’ll mess around with that abit. Thank you! :slight_smile: