Computer Science Canada Sprintes/Forks/ |
Author: | Tallguy [ Mon Jun 01, 2009 8:23 am ] |
Post subject: | Sprintes/Forks/ |
So my group and I are working on our final project, a star wars sprint game, we are having problems with -forking our process together (flicker free) -collision dection (troopers suppose to stop 75 pikels away from dooku) -troopers shooting on their on accord once they are 75 pikels away anyone help??? any suggestions |
Author: | tjmoore1993 [ Tue Jun 02, 2009 9:10 am ] | ||||
Post subject: | RE:Sprintes/Forks/ | ||||
This is what I've got so far, I am too sick to go on. Walkman procedure (process fails)
Also your down key wasn't working, check it out now ![]() |
Author: | tjmoore1993 [ Tue Jun 02, 2009 9:21 am ] |
Post subject: | RE:Sprintes/Forks/ |
To add, you really should think about revising the code a bit, to ensure that it is being done right because you could really turn that into an easy 100 lined code or 200 minimum. ![]() |
Author: | Tallguy [ Tue Jun 02, 2009 9:24 am ] |
Post subject: | RE:Sprintes/Forks/ |
kk thanks man any ideas about the forking problems |
Author: | tjmoore1993 [ Tue Jun 02, 2009 12:35 pm ] |
Post subject: | RE:Sprintes/Forks/ |
Ideas? Well, just don't fork period. |
Author: | Tallguy [ Tue Jun 02, 2009 12:42 pm ] |
Post subject: | RE:Sprintes/Forks/ |
ummm er okay, then how would i get two procedures to run at the same time? |
Author: | TheGuardian001 [ Tue Jun 02, 2009 3:24 pm ] | ||
Post subject: | Re: Sprintes/Forks/ | ||
You don't run them at the same time, you run them sequentially. Instead of looping inside of your procedure, you have a main loop in your program which will run each procedure in order. For example
each section will run through one repetition, then move on to the next procedure. It alternates between moving each of them one space at a time. |
Author: | Tallguy [ Wed Jun 03, 2009 11:39 am ] |
Post subject: | Re: Sprintes/Forks/ |
@ the TheGuardian001 kk i did wat you suggested -not working!! anyo one have any ideas? still can't combine the troopers walking with dooku walking |
Author: | TheGuardian001 [ Wed Jun 03, 2009 2:48 pm ] | ||||||
Post subject: | Re: Sprintes/Forks/ | ||||||
Well, for one thing, you're only ever drawing dooku when the arrow keys are pressed. If you want him to be visible all the time, the Pic.Draw Call shouldn't be inside the input check. If the keys are not pressed, you should check which way he is facing and draw the correct direction picture (dooku_walk (1) / dooku_walkM (1)) For another, when I said that you shouldn't loop inside your procedure, I mean you really should only have the one main loop. outside of your procedure. If you loop inside of a procedure, the program won't progress past that point. For loops are included in this. Do the for loop manually so that only one frame is drawn per repetition instead of all of them. Otherwise, the trooper will have all of his frames drawn at the same time. instead of
you will need something more like
you will need to change every time you used a loop / for loop to something like that. That way, it will draw one frame of each character each time the loop runs, and the animation will be smooth. For regular loops (like your block one) you will need to simply set a variable to say if he's blocking. Ie:
|
Author: | tjmoore1993 [ Wed Jun 03, 2009 3:02 pm ] |
Post subject: | RE:Sprintes/Forks/ |
This is my way of doing it ![]() ![]() |
Author: | Tallguy [ Wed Jun 03, 2009 7:54 pm ] |
Post subject: | RE:Sprintes/Forks/ |
@ TheGuardian001 woe!! okay, i'll trying doing wat you suggested, a lot of work.... @tjmoore1993 so confused |
Author: | Tallguy [ Fri Jun 05, 2009 8:17 am ] | ||||||
Post subject: | Re: Sprintes/Forks/ | ||||||
TheGuardian001 wrote: Well, for one thing, you're only ever drawing dooku when the arrow keys are pressed. If you want him to be visible all the time, the Pic.Draw Call shouldn't be inside the input check. If the keys are not pressed, you should check which way he is facing and draw the correct direction picture (dooku_walk (1) / dooku_walkM (1)) For another, when I said that you shouldn't loop inside your procedure, I mean you really should only have the one main loop. outside of your procedure. If you loop inside of a procedure, the program won't progress past that point. For loops are included in this. Do the for loop manually so that only one frame is drawn per repetition instead of all of them. Otherwise, the trooper will have all of his frames drawn at the same time. instead of
you will need something more like
you will need to change every time you used a loop / for loop to something like that. That way, it will draw one frame of each character each time the loop runs, and the animation will be smooth. For regular loops (like your block one) you will need to simply set a variable to say if he's blocking. Ie:
okay tried doing wat you said, attached is our attempt, some problems -when no keyboard is ressed boolean problems (currently commented out) -would i do the same thing with the troopers walking in? |
Author: | Tallguy [ Fri Jun 05, 2009 8:18 am ] | ||||||
Post subject: | Re: Sprintes/Forks/ | ||||||
TheGuardian001 wrote: Well, for one thing, you're only ever drawing dooku when the arrow keys are pressed. If you want him to be visible all the time, the Pic.Draw Call shouldn't be inside the input check. If the keys are not pressed, you should check which way he is facing and draw the correct direction picture (dooku_walk (1) / dooku_walkM (1)) For another, when I said that you shouldn't loop inside your procedure, I mean you really should only have the one main loop. outside of your procedure. If you loop inside of a procedure, the program won't progress past that point. For loops are included in this. Do the for loop manually so that only one frame is drawn per repetition instead of all of them. Otherwise, the trooper will have all of his frames drawn at the same time. instead of
you will need something more like
you will need to change every time you used a loop / for loop to something like that. That way, it will draw one frame of each character each time the loop runs, and the animation will be smooth. For regular loops (like your block one) you will need to simply set a variable to say if he's blocking. Ie:
okay tried doing wat you said, attached is our attempt, some problems -when no keyboard is ressed boolean problems (currently commented out) -would i do the same thing with the troopers walking in? |
Author: | TheGuardian001 [ Fri Jun 05, 2009 2:49 pm ] | ||
Post subject: | Re: Sprintes/Forks/ | ||
You have the right idea for no keys pressed, however chars(' ') checks spacebar, not a lack of input. you can use if not chars(KEY_LEFT_ARROW), which will check and make sure the left arrow is not pressed. Do the same for any other keys used. Now, if you were to implement the code for drawing the character with the structure you have now, the program would run in this order (assuming no keys pressed).
The problem with that is that you will only ever see the left facing frame. There is no actual need to use 2 separate procedures here, just a variable that will hold which way the player is currently facing. Try combining input procedures together in to one main input procedure. And yes, you will have to do the same thing for the trooper, however in his procedure there is no need to check for input. |
Author: | gunsnr1992 [ Tue Jun 09, 2009 11:58 am ] |
Post subject: | Re: Sprintes/Forks/ |
I am worki0ng with Tallguy on this starwars game i need some help with the entrance and boundaries for the troopers and getting them to walk in at the same time smoothley and stopping at a specific distance away from the main character. |