Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Shooting game: what is not working?
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
evildaddy911




PostPosted: 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



basic game.t
 Description:
a,d (left/right); w(jump); click(shoot)

Download
 Filename:  basic game.t
 Filesize:  3.59 KB
 Downloaded:  73 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
Dreadnought




PostPosted: 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.
evildaddy911




PostPosted: 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
Raknarg




PostPosted: 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?
Dreadnought




PostPosted: 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).
evildaddy911




PostPosted: Wed Dec 07, 2011 9:29 am   Post subject: RE:Shooting game: what is not working?

exactly dreadnought
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 6 Posts ]
Jump to:   


Style:  
Search: