diff options
| author | 1029chris <1029chris@gmail.com> | 2016-04-20 10:19:52 -0700 |
|---|---|---|
| committer | 1029chris <1029chris@gmail.com> | 2016-04-20 10:19:52 -0700 |
| commit | 5b9e47c1f86fbcd910d96b5d5c76c5d3b7fbf31c (patch) | |
| tree | 4bc7be62c9967ba6d9c8694b297d1301416bf81a /virus1.lua | |
| parent | 04890d4e9ef8dc4c1e8578d037c456b12464e89d (diff) | |
Virus now moves smoothly
Also added global time variable
Diffstat (limited to 'virus1.lua')
| -rw-r--r-- | virus1.lua | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -62,6 +62,7 @@ function drawVirusFight1() v1.c.xd = sys.w/2 v1.c.yd = sys.h/2 end + v1.c.sp = math.sqrt(math.abs(v1.c.xd - v1.c.x)*2 + math.abs(v1.c.yd - v1.c.y)*2)/5 v1.c.angle = math.atan2((v1.c.yd - v1.c.y), (v1.c.xd - v1.c.x)) v1.c.spx = v1.c.sp * math.cos(v1.c.angle) v1.c.spy = v1.c.sp * math.sin(v1.c.angle) |
