Computer Science Canada

Shooting game: what is not working?

Author:  evildaddy911 [ Tue Dec 06, 2011 4:08 pm ]
Post subject:  Shooting game: what is not working?

What is it you are trying to achieve?
shooting game, click to shoot

What is the problem you are having?
When I click to shoot, nothing happens

Describe what you have tried to solve this problem
I have no idea what is going wrong in order to fix it

Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
See below

Please specify what version of Turing you are using
4.1.1

Author:  Dreadnought [ Tue Dec 06, 2011 4:39 pm ]
Post subject:  Re: Shooting game: what is not working?

When you draw your "bullet" with

drawoval (round (blt (i).x), round (blt (i).y), 10000, 10000, black)

You're making a circle of radius 10000 pixels. That might be somewhere around 10 times the width of your screen.

Author:  evildaddy911 [ Tue Dec 06, 2011 5:00 pm ]
Post subject:  RE:Shooting game: what is not working?

yeah, i was using that to figure out where my bullet was, but I changed that to 10 and determined that it was in the bottom left corner... ignore that part

Author:  Raknarg [ Tue Dec 06, 2011 7:12 pm ]
Post subject:  RE:Shooting game: what is not working?

var blt : array 1 .. round (Math.Distance (25, 25, 500 - 25, 500) / speed) of shot

What;s with that upper bound, first of all?

Author:  Dreadnought [ Tue Dec 06, 2011 7:25 pm ]
Post subject:  Re: Shooting game: what is not working?

I think he's calculated the maximum number of bullets he could ever possibly have on screen at any given time. The distance from (25,25) to (475,500) is probably the diagonal distance between opposite corners of the level zone. Since he only creates one bullet per frame, and he moves each bullet 5 pixels per frame, the most bullets he could ever have on screen is the distance divided by the displacement per frame (5 pixels).

Author:  evildaddy911 [ Wed Dec 07, 2011 9:29 am ]
Post subject:  RE:Shooting game: what is not working?

exactly dreadnought


: