Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- all infected need to sync:
- (obviously):x,y,hspeed,vspeed,hp
- you might wanna sync global.difficulty as well,as they're affected alot to game play
- true/false variable:
- -alerted
- -stumble
- -attacking
- non true/false variable:
- -climb(0-2)damn!maybe you can do the last 2 bit in the byte is the climb?like:
- 00000001 is climb=1 and 00000010 is climb=2 .is it possible?
- -burning(0-255)
- -sprite_index(idk,maybe we dont need this)
- //special infected part:
- leaker planted:only synce the attacking and hp
- boomer:doingsth(t/f) and recharge(0-900)
- gorefast:doingsth(t/f) and recharge(0-80)*/
- write_ubyte(global.serializeBuffer, x)
- write_ubyte(global.serializeBuffer, y)
- write_ubyte(global.serializeBuffer, hspeed*5)
- write_ubyte(global.serializeBuffer, vspeed*5)
- write_ubyte(global.serializeBuffer, hp)
- write_ubyte(global.serializeBuffer, burning)
- byte = 0
- //Order: climb|climb|alerted|stumble|attacking|0|0|0
- // Bit_set arg: num;pos;0/1
- if climb == 1
- {
- bit_set(byte, 0, 1)
- }
- else if climb == 2
- {
- bit_set(byte, 0, 1)
- bit_set(byte, 1, 1)
- }
- if alerted
- {
- bit_set(byte, 2, 1)
- }
- if stumble
- {
- bit_set(byte, 3, 1)
- }
- if attacking
- {
- bit_set(byte, 4, 1)
- }
- write_ubyte(global.serializeBuffer, byte)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement