Advertisement
Guest User

Untitled

a guest
Sep 21st, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. /*
  2. all infected need to sync:
  3. (obviously):x,y,hspeed,vspeed,hp
  4. you might wanna sync global.difficulty as well,as they're affected alot to game play
  5. true/false variable:
  6. -alerted
  7. -stumble
  8. -attacking
  9. non true/false variable:
  10. -climb(0-2)damn!maybe you can do the last 2 bit in the byte is the climb?like:
  11. 00000001 is climb=1 and 00000010 is climb=2 .is it possible?
  12. -burning(0-255)
  13. -sprite_index(idk,maybe we dont need this)
  14. //special infected part:
  15. leaker planted:only synce the attacking and hp
  16. boomer:doingsth(t/f) and recharge(0-900)
  17. gorefast:doingsth(t/f) and recharge(0-80)*/
  18.  
  19. write_ubyte(global.serializeBuffer, x)
  20. write_ubyte(global.serializeBuffer, y)
  21.  
  22. write_ubyte(global.serializeBuffer, hspeed*5)
  23. write_ubyte(global.serializeBuffer, vspeed*5)
  24.  
  25. write_ubyte(global.serializeBuffer, hp)
  26.  
  27. write_ubyte(global.serializeBuffer, burning)
  28.  
  29. byte = 0
  30.  
  31. //Order: climb|climb|alerted|stumble|attacking|0|0|0
  32. // Bit_set arg: num;pos;0/1
  33.  
  34. if climb == 1
  35. {
  36. bit_set(byte, 0, 1)
  37. }
  38. else if climb == 2
  39. {
  40. bit_set(byte, 0, 1)
  41. bit_set(byte, 1, 1)
  42. }
  43.  
  44. if alerted
  45. {
  46. bit_set(byte, 2, 1)
  47. }
  48.  
  49. if stumble
  50. {
  51. bit_set(byte, 3, 1)
  52. }
  53.  
  54. if attacking
  55. {
  56. bit_set(byte, 4, 1)
  57. }
  58.  
  59. write_ubyte(global.serializeBuffer, byte)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement