@@ -271,12 +271,12 @@ function updateCell(_n,dt)
271
271
c .dir = math.atan2 (player .y - c .nucleus .y ,player .x - c .nucleus .x )
272
272
end
273
273
local dir = c .dir
274
- --[[ if love.keyboard.isDown("right","left","down","up ") then
274
+ --[[ if love.keyboard.isDown("right","f"," left","s"," down","d","up","e ") then
275
275
acc = mediumDamping * c.genes.speed
276
- if love.keyboard.isDown("right") then dir = 0 end
277
- if love.keyboard.isDown("left") then dir = math.pi end
278
- if love.keyboard.isDown("down") then dir = 0.5*math.pi end
279
- if love.keyboard.isDown("up") then dir = 1.5*math.pi end
276
+ if love.keyboard.isDown("right","f" ) then dir = 0 end
277
+ if love.keyboard.isDown("left","s" ) then dir = math.pi end
278
+ if love.keyboard.isDown("down","d" ) then dir = 0.5*math.pi end
279
+ if love.keyboard.isDown("up","e" ) then dir = 1.5*math.pi end
280
280
end]]
281
281
nax = nax + acc * math.cos (dir )
282
282
nay = nay + acc * math.sin (dir )
@@ -287,7 +287,7 @@ function updateCell(_n,dt)
287
287
local continue = false
288
288
local newax = 0
289
289
local neway = 0
290
- -- check for collisions :
290
+ -- check for COLLISIONS :
291
291
-- with player:
292
292
if distance (c .membrane [i ],c .membrane [i + 1 ],player .x ,player .y ) < plen + 2 then
293
293
hitPlayer (1 )
@@ -421,16 +421,16 @@ function love.update(dt)
421
421
if love .mouse .isDown (" l" ," r" ) then fire (mx ,my ) end
422
422
423
423
local md = nil
424
- if love .keyboard .isDown (" right" ) then
425
- if love .keyboard .isDown (" up" ) then md = 1.75 * math.pi
426
- elseif love .keyboard .isDown (" down" ) then md = 0.25 * math.pi
424
+ if love .keyboard .isDown (" right" , " f " ) then
425
+ if love .keyboard .isDown (" up" , " e " ) then md = 1.75 * math.pi
426
+ elseif love .keyboard .isDown (" down" , " d " ) then md = 0.25 * math.pi
427
427
else md = 0 end
428
- elseif love .keyboard .isDown (" left" ) then
429
- if love .keyboard .isDown (" up" ) then md = 1.25 * math.pi
430
- elseif love .keyboard .isDown (" down" ) then md = 0.75 * math.pi
428
+ elseif love .keyboard .isDown (" left" , " s " ) then
429
+ if love .keyboard .isDown (" up" , " e " ) then md = 1.25 * math.pi
430
+ elseif love .keyboard .isDown (" down" , " d " ) then md = 0.75 * math.pi
431
431
else md = math.pi end
432
- elseif love .keyboard .isDown (" up" ) then md = 1.5 * math.pi
433
- elseif love .keyboard .isDown (" down" ) then md = 0.5 * math.pi end
432
+ elseif love .keyboard .isDown (" up" , " e " ) then md = 1.5 * math.pi
433
+ elseif love .keyboard .isDown (" down" , " d " ) then md = 0.5 * math.pi end
434
434
435
435
local nax ,nay = 0 ,0
436
436
@@ -537,5 +537,7 @@ function love.draw()
537
537
love .graphics .setColor (255 ,255 ,255 ,255 )
538
538
love .graphics .polygon (" line" ,c .membrane )
539
539
love .graphics .circle (" line" ,c .nucleus .x ,c .nucleus .y ,2 ,10 )
540
+ love .graphics .setColor (0 ,0 ,0 ,255 )
541
+ for j = 1 ,c .mbsize ,2 do love .graphics .point (c .membrane [j ],c .membrane [j + 1 ]) end
540
542
end
541
543
end
0 commit comments