Computer Science Canada buttons and movement combined |
Author: | kythoon [ Tue May 13, 2003 4:33 pm ] |
Post subject: | buttons and movement combined |
in the attached program, i have figured out the movement of the character and now i am wanting to put the buttons on the bottom for the user to use. if i use GUI.ProcessEvent, the screen is blank how do i fix that so that the user can move and click on buttons on the same time? Also how do i return back to the screen after one of the buttons are pressed? Finally how do i make the computer reconize that the character is in the door way? I think you have to check the location of the door way to the character location. I dont mind if it goes through walls though. thanks for the help tell me if i forgot ne files. |
Author: | Tony [ Tue May 13, 2003 4:49 pm ] |
Post subject: | |
seems you forgot all of the files the way GUI.ProcessEvent works, I figure - it would work if you'd stick it into a process and let it run there in a loop. I donno what you mean by "return" back to screen... just call the procedure for the "screen" you were using before. To check if you're in a doorway, you compare character location to the door location. If they're identical (or whithin reasonable distance) you may continue. |
Author: | kythoon [ Tue May 13, 2003 5:45 pm ] |
Post subject: | |
sorry about that |
Author: | Homer_simpson [ Tue May 13, 2003 6:00 pm ] | ||
Post subject: | |||
I believe this is what you wanted.... |
Author: | kythoon [ Tue May 13, 2003 6:30 pm ] |
Post subject: | |
yup, thanks any idea how to get the location the door way when change the screen when character is there. thanks for the help homer |
Author: | Homer_simpson [ Tue May 13, 2003 8:06 pm ] |
Post subject: | |
you can use the distance formula to detect if the character is close enough to go inside the room... and you also need to prevent yer character from going through the walls =/ |
Author: | kythoon [ Tue May 13, 2003 8:45 pm ] |
Post subject: | |
ok, but would the coordinates of the picture door way change each time the picture, the background, is moved. |
Author: | Homer_simpson [ Tue May 13, 2003 9:20 pm ] |
Post subject: | |
hmmm... well u could use another method.... u could use whatdotcolor to see if there's a wall in front of u using the colors...it's prett lame but it'll do... |