Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Kartik Agaram

9
Posts
63
Followers
A member registered Mar 30, 2023 · View creator page →

Creator of

Recent community posts

Whoa, I had no idea! Thanks I'll try that.

It's just a program for teaching kids programming that I happened to make during the time of the Jam :)

Could you share a .love file? <3

Thanks! No, I didn't have any specific criticism. I'm not a game developer, I just use LÖVE to build productivity apps for myself. So I'm not very well-versed in the trade-offs of different game engines and was curious to hear more to learn from.

I'm curious about your motivations in building this, particularly compared to just using love2d. (Perhaps this should go in a FAQ?)

(1 edit)

That is a good question, if I understand you right. The above program keeps the top-left corner of the viewport fixed. Is that what you meant?

Since then I made a change to it to keep the centroid between fingers fixed:

function car.touchmoved(id, x,y, ...)
  if start[id] then
    curr[id] = {x=x, y=y}
    if s then
      local oldzoom = v.zoom
      v.zoom = dist(curr[f], curr[s])/dist(start[f], start[s])*initzoom
      adjust_viewport(oldzoom, v.zoom)
    elseif f then
      v.x = initpos.x + iscale(start[f].x - x)
      v.y = initpos.y + iscale(start[f].y - y)
    end end end
function adjust_viewport(oldzoom, zoom)
  -- ensure centroid of fingers remains in view
  local c = centroid(curr[f], curr[s])
  v.x = v.x + c.x/oldzoom - c.x/zoom
  v.y = v.y + c.y/oldzoom - c.y/zoom
end
function centroid(a, b)
  return{x=(a.x+b.x)/2, y=(a.y+b.y)/2}
end
function iscale(d) return d/v.zoom end
(1 edit)

There still seem to be some functions missing, e.g.

  • getX getMaxX getY getMaxY
  • getPlayerX getPlayerY getPlayerX getPlayerY

What framework are you using?

Oh I see! That does make sense, and I don't see why not. You should give it a go, and I'll try to run it as well and see what happens.

Sorry I don't follow you. Lua isn't a shoot 'em up or even a game.