A_SetAngle

From ZDoom Wiki
Jump to: navigation, search

A_SetAngle (float angle)
A_SetAngle (float angle [, int flags]) (development version 67ebbe3 only)
A_SetAngle (float angle [, int flags [, int pointer]]) (development version 19b43d4 only)

Usage

Sets the calling actor's (or the pointed to actor's (development version 19b43d4 only)) angle to angle. It can be used with the angle DECORATE variable to modify the actor's current angle.

Parameters

Examples

This zombie spins in circles in his spawn state.

ACTOR SpinningZombieMan:ZombieMan replaces ZombieMan
{
  States
  {  
  Spawn:
    POSS ABCD 4 A_SetAngle(15+angle)
    loop
  }
}

This firing state randomly jumps the view to the left or right using A_SetAngle.

Fire:
  PISG B 0 A_GunFlash
  PISG B 0 A_Jump(128, "SpinLeft")
  PISG B 0 A_SetAngle(angle+((abs(velx)+abs(vely)+abs(velz))/10))
  goto SpinDone
SpinLeft:
  PISG B 0 A_SetAngle(angle-((abs(velx)+abs(vely)+abs(velz))/10))
SpinDone:
  PISG B 0 A_SetPitch(pitch-((abs(velx)+abs(vely)+abs(velz))/6))
  PISG B 0 A_PlaySound("Weapons/Pistol")
  PISG B 3 offset(3, 39) A_FireBullets(1, 1, -1, 12, "BulletPuff")
  PISG C 2 offset(2, 37)
  PISG D 2 offset(1, 35)
  PISG D 0 offset(0, 32)
  Goto Ready