The Daily Click ::. Forums ::. Klik Coding Help ::. Making Bullets Bounce!?
 

Post Reply  Post Oekaki 
 

Posted By Message

Silveraura

God's God

Registered
  08/08/2002
Points
  6747

Game of the Week WinnerKlikCast StarAlien In Training!VIP Member360 OwnerWii OwnerSonic SpeedThe Cake is a LieComputerChristmas Tree!
I am an April Fool
29th August, 2003 at 23:39:14 -

Is there ANYWAY of making a bullet bounce off walls using Bouncing Movement?

 
http://www.facebook.com/truediamondgame

Knudde (Shab)

Administrator
Crazy?

Registered
  31/01/2003
Points
  5125

Has Donated, Thank You!Clickzine StaffKlikCast StarVIP MemberGhostbuster!Dos Rules!I donated an open source project
30th August, 2003 at 01:35:42 -

If you have your guy create a new bullet when he fires as opposed to using the built in shoot event. Then Have the condition [Bullet collides with Wall] - [Bounce]; however that is unpredictable sometimes. A better way would be to set the direction of the bullet when it collides. And remember, most objects will bounce off at the same angle they hit the surface at, a way to simulate this would be to set the direction of the bullet to it's current direction - 16. This method sometime causes wierd glitches, but at least you get the idea. Also, you would want to have the bullet bounce off of a couple walls then be destroyed. The alterable values of the bullet could be used to track how many times it have collided with a wall. Would have to use a"onle once when event loops" part in there though (for the collisions.)

 
Craps, I'm an old man!

Penguin Seph



Registered
  11/12/2002
Points
  1338
30th August, 2003 at 02:51:10 -

What I'd do is make 2 bullet's, one is shot, and the other is given Bouncing Movement. (Call em Bullet shot and Bullet bound) Now then, player shoots "Bullet shot" at whatever and when it hit's a wall, kill "Bullet shot" and cereat "Bullet bound" and wherever "Bullet bound" hit's a wall it bounces.

 
Hi!

Kramy



Registered
  08/06/2002
Points
  1888
1st September, 2003 at 14:56:23 -

Or...Use the fastloop object.

When you're facing a genneral "left" direction, create the bullet and set the direction left.
When you're facing a genneral "right" direction, create the bullet and set the direction right.

If bullet is not overlapping backdrop/active object bullet can bounce off
start fastloop 0 for 500 loops(can be changed)

Loop 0
If bullet is not overlapping backdrop/active object bullet can bounce off
Set position to "whereever" depending on direction

If bullet is overlapping backdrop/active object bullet can bounce off
create semi-transparent "bounce effect"(small yellow flash, etc.)
Set direction to bullet dir + 12 + random( 9 )
add 1 to alt.a

Alt a = 4
destroy bullet.

------------------------------------------
That creates a cool richochet effect, provided I described it properly. Using that you don't actually need to "see" the bullet.

Image Edited by the Author.

 
Kramy
   

Post Reply



 



Advertisement

Worth A Click