Computer Science Canada [Help] Yet Again, proc and Loops, and loops in loops |
Author: | razrdude [ Mon Oct 30, 2006 6:05 pm ] | ||
Post subject: | [Help] Yet Again, proc and Loops, and loops in loops | ||
Hey well whoever's been following my posts, Ive now added ship movements and have the ship moving around, but now the problem is that the scope is being drawn once only and its not moving with the mouse. I know its cuz of the cls and View Image but I do not know how to fix it. Ill post my code here, but its better if you dl the file cuz there are images. Thanks a lot for all help. btw I have to do these: 1. Get scope to show and moving 2. Collision Detection, ship gets blasted 3. Ship spawn 4. Parameters maybe. 5. Instructions and Documentation
If you want to test to see if the scope is being made, put ur mouse on the middle of the screen and press F1 (run). Thanks |
Author: | Piro24 [ Mon Oct 30, 2006 8:54 pm ] |
Post subject: | |
I'm a noob in Turing too (started about 3-4 weeks ago), but... What's the point in making your entire code a procedure? If you are going to do it all in one loop, don't use a procedure...That way the Mouse.Where will apply to your scope... |
Author: | razrdude [ Mon Oct 30, 2006 9:01 pm ] | ||
Post subject: | |||
Yea i got a fix from Ultrahex [All hail Ultrahex]
but now the scope appears on top of the spaceship, how do i fix that? Also need help with collision detection. |
Author: | Expirant [ Mon Oct 30, 2006 11:10 pm ] |
Post subject: | |
To get the spaceship to appear beneath the crosshair you need to draw the spaceship over the crosshair. I'm not really sure what picUnderMerge does exactly...but it looks like it moves that particular picture to the back? Anyways, moving your drawing of the spaceship to the end of your code (so...drawing it last) should fix it. I would separate your code into a more organized fashion, though, to give you more flexibility with it. Good luck, Expirant |
Author: | razrdude [ Tue Oct 31, 2006 12:58 am ] | ||
Post subject: | |||
Hey people here is what i have so far. The only problem is that Now I need the mouse to click in a specific range to make the health go down.
I put a lot of % where the part I am having problems with, to help you find it. Btw pls dont flame for the way I did this code, I am running out of time and couldnt do it the short way. All Help is appreciated. btw if you guys require the whole folder i can attach it on my next post |
Author: | [Gandalf] [ Tue Oct 31, 2006 3:20 am ] | ||||
Post subject: | |||||
First off, you'll want to replace all these:
with the proper elsif structue:
Then, read through my PM, if this is the topic you were referring to. |
Author: | razrdude [ Tue Oct 31, 2006 3:49 am ] | ||
Post subject: | |||
ok I did that but still having problem with getting the ship to stop drawing and moving, cuz on the 22nd click the explosion picture goes away and the ship keeps on moving. Here is the updated code:
Thanks for all your help |
Author: | Clayton [ Tue Oct 31, 2006 1:24 pm ] | ||||||||
Post subject: | |||||||||
Things like this break my heart:
That whole entire if statement can be broken down into:
also, the reason it doesnt work after the 22nd click is this:
because i will never equal 21 and 22 at the same time, you will never get the required results. Put the:
outside of everything else, and you *should* be fine |
Author: | Cervantes [ Tue Oct 31, 2006 1:47 pm ] | ||
Post subject: | |||
Freakman wrote: That whole entire if statement can be broken down into:
In terms of speed, that's still terrible. Loading the picture from the file is slow. That's why we do that at the beginning of our program. If we wanted to load the picture from file during the execution, we would just use Pic.ScreenLoad. razrdude, you should really learn to use arrays |
Author: | razrdude [ Tue Oct 31, 2006 3:04 pm ] | ||
Post subject: | |||
Actually the speed is not that bad, btw i tried what Freakman gave and it gave back errors Ok here is what I have now. Ok Now all I have to do is add in the Boom Sound when the button click is at 21, add in boundaries for the ship, and Im having problems at the bottom calling upon the Draw procedure. Is this because draw has formal parameters? Please help me on these issues.
|
Author: | Cervantes [ Tue Oct 31, 2006 4:47 pm ] |
Post subject: | |
razrdude wrote: Actually the speed is not that bad, btw i tried what Freakman gave and it gave back errors Ok here is what I have now.
Relative to what the speed should be, I can just about guarentee your speed is terrible. You should really go learn arrays. Now. It will help you so much. |