simple shoot
Author |
Message |
new
|
Posted: 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

|
|
 |
SuperGenius
|
Posted: 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

|
Posted: 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.  |
|
|
|
|
 |
|
|