-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathKendraKat.rb
More file actions
41 lines (33 loc) · 724 Bytes
/
Copy pathKendraKat.rb
File metadata and controls
41 lines (33 loc) · 724 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
require 'robot'
class KendraKat
include Robot
def tick events
turn_radar 1 if time == 0
@my_acceleration = 1 if time == 0
if events['robot_scanned'].empty?
turn 2
turn_gun 5
accelerate @my_acceleration
else
turn_gun -9
#if events["robot_scanned"][0][0].to_i < 7000
fire 3
#else
#fire 2.5
#end
end
@last_hit = time unless events['got_hit'].empty?
#if @last_hit && time - @last_hit < 10
if not events['got_hit'].empty?
if speed > 0
@my_acceleration = -1
else @my_acceleration = 1
end
say "ouch!"
end
buffer_size = 100
if x < buffer_size or x > battlefield_width - buffer_size or y < buffer_size or y > battlefield_height - buffer_size
turn 8
end
end
end