Geekboy

Untitled

Feb 8th, 2012
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Follow_player:     ; gets a angle via the arctan function and sends the attack torwards the player
  2.  push hl \ inc sp ; move the stack back to proper positions as we
  3.  ld hl,0          ; are moving it into temp storage
  4.  add hl,sp
  5.  ld sp,(itemp1)   ; old stack value was stored here
  6.  push hl          ; we have a stack now lets use it
  7.   ex af,af'       ; needed this last time dont ask me why
  8.  push af         ; save the shadow aff for some bloody reason
  9.  
  10.   ld hl,(chary)   ; de = your pos
  11.   srl h \ srl h
  12.   srl l \ srl l
  13.   ex de,hl
  14.   call r.arctan   ; returns angle in c and a
  15.                ; we leave it there so we can restore the stack
  16.  
  17.  
  18.  pop af
  19.  ex af,af'
  20.  pop hl
  21.  ld sp,hl
  22.  
  23.  ld a,c    ; put angle in a
  24.  
  25.  pop de
  26.  push de ; restore xy
  27.  jp moveang
  28.   ; we can do my own shit now stack is inited and old one is saved
Advertisement
Add Comment
Please, Sign In to add comment