Free Developer Support

Hi James,

I was wondering if you could take a look at this problem:
http://developer.anscamobile.com/forum/2012/02/19/collecting-items-game-problem

I have a character that’s constantly bouncing up & down and it’s physics shape is a circle, but the problem I am facing is that when it hit the walls I have set up, it sticks to them. Thank you very much for your help in advance. I really appreciate it. [import]uid: 122802 topic_id: 20965 reply_id: 95651[/import]

OMG, I think I went so far down the twitter whole that I didn’t know where I came from. The documentation for starting the REST API there is some of the most confusing API documentation I’ve ever seen.

At first things were looking good, but then I found out there was a whole bunch of other stuff you needed to do to even begin to make requests to the twitter API.

I kept looking for a better solution to the problem and all of a sudden almost two months roll by! To put it short, it can be done, but way too much work is needed to make an api that’s flexible.

I’m sorry for the people who waited for this one, but it was just too much time for me to make, and it was taking more than an hour of time a day to get it to where I wanted it.
[import]uid: 49520 topic_id: 20965 reply_id: 104127[/import]

OMG, James, it’s so nice of you to follow up on Twitter thing. I really appreciate it. It does sound like something super complex to deal with. I wonder if Ansca would eventually work out Twitter API that’s easier for users to implement (something like the Facebook API they’ve integrated to Corona).

Thanks again.

Naomi [import]uid: 67217 topic_id: 20965 reply_id: 104133[/import]

Uh! This is the first time I’m seeing this thread.I think I’ve been living under a rock. :open_mouth:

Anyway,Really Awesome Work guys! Hats off!
Will try to contribute to this thread sometime :slight_smile: [import]uid: 64174 topic_id: 20965 reply_id: 104135[/import]

@Satheesh,

Thanks man. If you have a question that you think will take an hour to answer, post the question here and I’ll try to answer it.

[import]uid: 49520 topic_id: 20965 reply_id: 104138[/import]

I was thinking of making a set of tutorials for things that we would want to see visually walked through. The criteria would based on a voting or poll system which basically means that everyone would have a say in what gets in the tutorial.

What’s your thoughts on this? Let me know in the reply below. [import]uid: 49520 topic_id: 20965 reply_id: 104289[/import]

James,

wow thats a really good idea.

i would love a visually walk through. it would be helpful and probably easier for others to learn. [import]uid: 17701 topic_id: 20965 reply_id: 104308[/import]

Hello James/Kent

WOW! First time seeing this thread. I am must have been asleep:)

Anyway, I would really appreciated if you would not mind looking to the code below. It “works” but not sure if is the best way to do what i need. Here the “quick” story.
Here my original post on this issue:

http://developer.anscamobile.com/forum/2012/04/21/how-destroy-enemy-boss-overtime-during-single-collision

I am basically using a global collision listener to destroy on collision some rocks. I just move a gun cross on top of some rock and they get destroyed. That seems to work perfectly (both the gun cross and the rocks use physics. Now I want to add a different type of rock (rock.type = “boss”) which are more difficult to destroy. To keep the code sample, I thought I could use a timer that would time the gun cross being over the rock (colliding with the rock) and if the rock is of Boss type then after say 1 second, the rock will be destroyed. If for some reason the player cannot keep the gun cross over the rock long enough (less than 1 second) then the timer (called here bossTimer) will be canceled in the “ended” phase of the runtime collision. Please note the collision also check for other collision like the ones between rocks and the walls outside the screen.

Like i said it seems to work but I am affraid about doing so much stuff during a collision. I was wondering if you may have a better idea, maybe less complicated idea on to accomplish my primary goal: Delay the destruction of a rock if it’s type is “boss” The rocks are spawned using a timer and the type is randomly set when they spawned toward the screen (they are spwaned from outside the screen and given a velocity toward other objects on the screen.

I am sure i gave way too much details and probably confused the issue!

Please see my current code below (i removed some code to help on the reading of it)
THANKS for doing this by the way (helping people in general I mean)

Mo
(LairdGames)


[lua]
local bossTimer


local function destroyRock ( obj)

– GUN CROSS HIT NORMAL ROCK!

if fxOn then audio.play ( explosionSound ) end

score = score + 10*gameLevel

– explosion code here

display.remove(obj)
obj = nil

return true

end


local function destroyBoss ( obj)

– GUN CROSS HIT THE BOSS ROCK!

if fxOn then audio.play ( explosionSound ) end

– explosion code here

score = score + 20*gameLevel

– remove rock display object

display.remove(obj)
obj = nil

return true

end


– Global Collision function

local function onRockCollision(event)

local phase = event.phase

if “began” == phase then

local obj1 = event.object1
local obj2 = event.object2

– check if the gun cross hit a rock (normal or boss) and that the gun is enable

if obj1.name == “gun” and obj2.name == “rock” and gunEnable == true then

– check if the rock hit is of type = boss

if obj2.type == “boss” then

– start BOSS timer

bossTimer = timer.performWithDelay(300,

function()
timer.cancel(bossTimer)
destroyBoss(obj2)
end, 1 )

else

– if just normal rock then simply destroy the rock display object

destroyRock(obj1,obj2)

end

– check if the gun cross hit a rock (normal or boss) and that the gun is enable (in case obj1 is a “rock”)

if obj1.name == “rock” and obj2.name == “gun” and gunEnable == true then

if obj1.type == “boss” then

– start BOSS timer

bossTimer = timer.performWithDelay(300,

function()
timer.cancel(bossTimer)
destroyBoss(obj1)
end, 1 )

else

destroyRock(obj2,obj1)

end

end

elseif phase == “ended” then

if bossTimer then

– cancel the bossTimer if the player moved the gun cross away from the boss rock

timer.cancel(bossTimer)

end

end

end[/lua] [import]uid: 100814 topic_id: 20965 reply_id: 104313[/import]

@James.

Not sure if you are asking about which tutorials we would like to see (GREAT idea by the way) but if it is then I would LOVE one on:

  • In-app purchasing
  • Ads
  • Twitter and Facebook integration

Thanks again for your generosity.

Mo
(LairdGames) [import]uid: 100814 topic_id: 20965 reply_id: 104315[/import]

@Laird,

Yes. I’m asking what tutorials you’d like to see and what you want to see covered in those topics (For example, what do you want to see done in using the facebook API?).

I want the tutorials to be clear and concise in its objective. Could you elaborate on the ones you breifly went over? [import]uid: 49520 topic_id: 20965 reply_id: 104317[/import]

@James. Sure:

  • In-app purchase. Would love to see for instance one of the free template (Air Hockey for instance) converted into an in-app purchase app. We could have the app itself as in an-app purchase but also maybe being able to buy “better” stick and so on.

  • Ads. It seems that ads with Corona is all over the place (maybe I am wrong) but a clear tutorial will be great.

  • Integration with Twitter like posting hi-score. A simple step by step process. It seems that there are many twitter info but would love the most current way of dealing with posting score on Twitter.

  • Same about Facebook. A simple way to post hiscore will be enough.

I am hoping to integrate some of those feature in my upcoming app and I have to admit that I am bit overwhelmed! Especially because the information is not always current

Please let me if you need more info.

THANKS

Mo [import]uid: 100814 topic_id: 20965 reply_id: 104322[/import]

@Laird,

On your issue regarding your collision event, everything looks good so far. The only thing I can recommend at the time is to turn it into an event listener for the gun exclusively. With runtime, this event will be triggered in any collision event, whether its with the gun or not. Adding it to the gun should save you in processing time overall.

I don’t know more on the needs of your game to say anymore, but keep up the good work! Aside from the global event listener, I had no issues reading what you said before or inside the code. [import]uid: 49520 topic_id: 20965 reply_id: 104335[/import]

@James.

Thanks a lot. I am happy for the confirmation. The one think i did not include (to reduce the size of code) is that i have another object that get hit by the rock on the screen. So the gun cross is not the only object that interact with those rocks. Maybe I can use some collision filtering…

Thanks again.

Mo. [import]uid: 100814 topic_id: 20965 reply_id: 104337[/import]

Yeah. If you don’t have it already in use I would suggest using it now, lol. [import]uid: 49520 topic_id: 20965 reply_id: 104338[/import]

Did that Facebook friend-list ever get implemented? If so, where can I grab the code? [import]uid: 6175 topic_id: 20965 reply_id: 104348[/import]

Hi, this is probably a quickie one for you. I am hoping to develop several projects in Corona, but I need the ability to draw directly onto an image? For example, I have a wall image and need to draw bullet holes onto the wall texture? Could you tell me if that is possible in Corona please?

Many thanks
Dean [import]uid: 75910 topic_id: 20965 reply_id: 104415[/import]

@idiot.dw,

It depends on what you mean by draw. If you you mean something like the app “Draw Something” where your finger draws using a pen, then no. Corona is not set up for that.

If you want to draw “decals” on top of background images, etc. then yes. Corona is very good at doing that. You could present the user with a selection of decals, let them pick on, then draw that decal where ever they tap on the screen. [import]uid: 16734 topic_id: 20965 reply_id: 104437[/import]

@dgaedcke,

Yea I released it to the guy privately. I have to clean up what he sent to me in his friend’s list and release it later this week. I’ll post back when I do. [import]uid: 49520 topic_id: 20965 reply_id: 104571[/import]

Hi, thanks for the reply

But what I mean is, I need to be able to draw an image on top of another image (usually background) permanently. With the bullet holes example, I know that I could just create a new bullet hole display object every time, but with hundreds of bullet holes this would be slow.

Because the bullet holes are permanent and do not move during the game, it is much better to ‘draw’ the bullet holes onto the background wall texture, in that way there is no performance loss regardless of how many bullet holes are in the wall.

Cheers
Dean [import]uid: 75910 topic_id: 20965 reply_id: 104638[/import]

@idiot.dw I’ve not done it myself, but I’ve seen others on the forum place graphics over another graphic, and then take a screenshot (programmatically) and then begin using the screenshot as the new original graphic…that may solve your concerns about performance or perhaps it’s not a good fit for your use-case. [import]uid: 6175 topic_id: 20965 reply_id: 104687[/import]