AP Computer Science help needed (GridWorld)

GEC: Discuss gaming, computers and electronics and venture into the bizarre world of STGODs.

Moderator: Thanas

Post Reply
User avatar
Qwerty 42
Jedi Council Member
Posts: 2008
Joined: 2005-06-01 05:05pm

AP Computer Science help needed (GridWorld)

Post by Qwerty 42 »

Okay, so it's my final for my AP Computer Science class, and I've bitten off way more than I can chew. My teacher has told me I can seek help if I need it, and I definitely need it. What I need to do is allow for a character in the Grid to move when the directional arrow keys are pressed. I've tried to add a KeyListener, but the problem seems to be that the Grid has an overriding command to move the grid selection square when the keys are pressed, but I've been completely unable to find it to change it.

http://www.horstmann.com/gridworld/

Any advice, anything at all, that could be given would be hugely appreciated. I know I shouldn't have gotten such a complicated project, but by the time I realized that I was in over my head I was too late. I'd just appreciate some kind soul to help bail me out.

Mercie,
Image Your head is humming and it won't go, in case you don't know, the piper's calling you to join him
User avatar
Questor
Jedi Council Member
Posts: 1601
Joined: 2002-07-17 06:27pm
Location: Landover

Post by Questor »

This may be a stupid question, but could you use the numeric keypad? Or even AWSD?

I'm not that good with Java, so I can't offer any advice on beyond that though.
User avatar
Qwerty 42
Jedi Council Member
Posts: 2008
Joined: 2005-06-01 05:05pm

Post by Qwerty 42 »

We definitely could, absolutely, the problem is that the program is ignoring any sort of key input, with the exception of the arrows. Since the arrows move the selection square, it seemed easiest to locate whatever was causing that square to move and tell it to move the character instead.
Image Your head is humming and it won't go, in case you don't know, the piper's calling you to join him
Post Reply