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

Username:   Password: 
 RegisterRegister   
 simple shoot
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
new




PostPosted: Sat Jan 08, 2005 7:47 am   Post subject: simple shoot

how to make a rectangle shoot using space bar and at teh same time, make an ai move left and right and it also shoots

is there a simple code..for this?
Sponsor
Sponsor
Sponsor
sponsor
SuperGenius




PostPosted: Sat Jan 08, 2005 9:32 am   Post subject: (No subject)

im sure there is somewhere... in the Turing Source Code or Turing Submissions forums.

however, you'll probably want to use Input.Keydown to check it they pressed the space bar, and then the rest is pretty simple. If you're confused look in the help file.
Cervantes




PostPosted: Sat Jan 08, 2005 10:30 am   Post subject: (No subject)

Make a flexible array of a record (x, y, vx, vy, startX, startY) to store everything you need to know about your bullet. Make the flexible array whenever you hit the fire key. Inside your main loop, you'll have your Input.KeyDown movement and also a for loop from 1 .. upper (your_flexible_array). Inside that for loop, update everything you need.
Check the code at the end of the Flexible array tutorial for some ideas. Smile
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  [ 3 Posts ]
Jump to:   


Style:  
Search: