This is my first day with Corona, however I have quite the experience with UDK, unfortunately not with LUA. I went through all the Docs from Resources and a few random tutorials trying to figure this out.
What I’m trying to do are a few, hopefully, simple things, at least they seem simple enough.
I have my gravity currently set at 10, but the number isn’t important. This also reminds me of a new question actually sorry. I just created a random background that’s 320x480 and added an addEventListener so that when I touch the background it does the onTouch function, my question regarding this is, if there’s something over the background and I touch there will the function not work? Only when the background get’s touched? If so, how would I do it whenever the person touches the screen no matter what he’s touching.
Anyway back to my other question. So gravity is set to 10. I want to create it so on touch the gravity is set to -10 so that the player goes the other way until he’s not touching the screen anymore. Going up and down at the same speed.
I also been trying to look into player creation, but I just want the bare minimum for the player to exist currently with no collision, how is this:
local function createPlayer(x, y, width, height, rotation)
local p = display.newRect(200, 150, 50, 50)
p:setFillColor(0, 0, 0)
p.objectType = "player"
physics.addBody ( p, "dynamic", playerBodyElement )
p.isSleepingAllowed = false
return p
end
Sorry again for the newbie question, thanks in advance for any help, really appreciate it. I wish you a nice weekend. [import]uid: 77199 topic_id: 23082 reply_id: 323082[/import]
).