Thanks to your help, I was able to figure this out. So… I guess I owe you $10.
There is another problem. Heh. no surprise here, it is with vectors, but it does not involve bullets or turrets.
What I am trying to do is something like 6:27 to 6:33 in my second post. For now, I just want that to happen once and here is what I tried.
function attack.smack(player, target) local hitBox = createContainer(parent, 500, 500) local player local angle = 0 local vec = ssk.math2d.angle2Vector( angle, true ) vec = ssk.math2d.add( target, vec ) player = vec end --this is how it is called in main.lua: local character = ssk.display.newCircle( group, centerX, centerY, { fill = \_R\_, radius = 10 }) physics.addBody(character, "dynamic", {isSensor = true}) local target = display.newRect(1, 1, 0, display.actualContentHeight) attack.smack(character, target)
I know for sure that the problem is with the vector coding I attempted to create in the attack.smack function.