Good day to all.
I am trying my hand at coding my first mobile game (strictly for learning purposes).
I have spent the last year, STRICTLY reading on Lua and Corona.
Yes I understand (more now) that I should have followed along entering the code as I read the books. However, I wanted to amass as much vocabulary information in my brain without having to actually code, and juste read through and see what is going on. It has been an adventure.
I have learned the LUA / CORONA language quite well, I feel, for having no human help outside of his or her textual help.
I am beginning now to understand what “they” mean by how Corona has simplified things for the lowly-developer! Had I programmed games before, I probably would know the COMPLETE extent that Corona is hiding behind the scenes.
Wish I had the time to look behind that infinite veil of code!
Anyway, all excitement for learning the Corona SDK aside, I was wondering, is there anything that I may not be aware of as far as keeping playing cards ON SCREEN aside from the following code. Is there any ERROR checking that is involved with something like this?
local moveCard = function(event)
KEEPS THE CARD FROM GOING OFF THE LEFT OR RIGHT SIDES OF THE SCREEN
If((card.x - card.width * 0.5) < 0) then
card.x = card.width * 0.5
Else-if ((card.x + card.width * 0.5) > display.contentWidth) then
card.x = display.contentWidth - card.width * 0.5
End
KEEPS THE CARD FROM GOING OFF THE TOP OR BOTTOM SIDES OF THE SCREEN
If((card.y - card.height * 0.5) < 0) then
card.y = card.height * 0.5
Else-if ((card.y + card.height * 0.5) > display.contentHeight) then
card.y = display.contentHeight - card.height * 0.5
End
end
Thanks anyone.
Chris
I will figure this out one way or the other! :)
PEACE