The Daily Click ::. Forums ::. Klik Coding Help ::. 360 Degree Active Object Rotation.
 

Post Reply  Post Oekaki 
 

Posted By Message

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
21st August, 2006 at 01:11:48 -

User clicks with left button (That means fire)
-Create Bullet at (0;0) from Player
-Bullet: Set alterable A to Angle("Player")
-Bullet: Set alterable B to X("Player")
-Bullet: Set alterable C to Y("Player")

Number of bullets > 0
-Start loop "bullet" 30 times (Or more, if you want faster bullets)

On loop "bullet"
-Bullet: Set value B to value B("Bullet") + Cos(Value A("Bullet"))
-Bullet: Set value C to value C("Bullet") + Sin(Value A("Bullet"))
-Bullet: Set X position to value B("Bullet")
-Bullet: Set Y position to value C("Bullet")

On loop "bullet"
Bullet collides with backdrop
-Bullet: Destroy

... And so on. I used alterable values because they allow decimals, so it's more accurate than just adding directly to the X and Y position.

 
n/a

Tina Petersen



Registered
  19/09/2003
Points
  350
22nd August, 2006 at 02:25:49 -

Ok this works bad.. sorry. If i turn the player around while bullets are flying.. they all turn around

isnt there a way just to put mouse x+y into the bullets values, and make it look that way all the time? Making the bullet at ball movement object.

 
- Eternal Life, Or Your Money Back -
http://www.befun.dk/
Currently looking for a home (team)

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
22nd August, 2006 at 08:40:09 -

If the bullets turn with the player, you've done something wrong.

When the player fires, you should set the bullet's alterable value A (or whatever) to the angle of the player. Then calculate the X and Y position of the bullet NOT from the player's angle directly, but from the bullet's value A.

I'll make an example...

 
n/a

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
22nd August, 2006 at 08:56:01 -

Here: http://aggggge.funpic.org/360shooting.cca

 
n/a

Tina Petersen



Registered
  19/09/2003
Points
  350
22nd August, 2006 at 09:36:25 -

yeah ur example works smooth :/
and done in my eyes exactly the same ..

http://www.befun.dk/JAZ.Simplifiedfortesting.cca

but no luck still.

 
- Eternal Life, Or Your Money Back -
http://www.befun.dk/
Currently looking for a home (team)

Tina Petersen



Registered
  19/09/2003
Points
  350
22nd August, 2006 at 09:44:56 -

Works now.. i had moved the hotspot of the bullet to make it better look as it came frmo the barrel.. somehow that interfered and i had to do a few extra calculations.

Image Edited by the Author.

 
- Eternal Life, Or Your Money Back -
http://www.befun.dk/
Currently looking for a home (team)
   

Post Reply



 



Advertisement

Worth A Click