Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Free Developer Support
Started by jamestimberlakejr Jan 26 2012 02:27 AM

- - - - -
126 replies to this topic
[TOPIC CONTROLS]
« Page 4 of 6 2 3 4 5 6
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#76

jamestimberlakejr

[GLOBAL: userInfoPane.html]
jamestimberlakejr
  • Enthusiast

  • 86 posts
  • Corona SDK

@GP,

I think you may have already figured that out in another part of your code. Have you tried adding this to the sprite event?

--now for the velocity to decrease during a certain period of time                                --this gives the look that it's winding down                                local function onSpriteSpin(event)                                        spin1.timeScale = spin1.timeScale - 0.7                                        if spin1.timeScale < 1 or spin1.timeScale == 1 then                                                spin1.timeScale = 1                                                                --@jt this will run on every frame event, so it will keep track of the frames you loose because of the spinning                                                if spinDir == "right" then                               	 	if spinNum >= 1 and spinNum < 15 then                                        spinNum = spinNum + 1                                	elseif spinNum == 15 then                                        spinNum = 1                                	end                                elseif spinDir == "left" then                                	if spinNum > 1 and spinNum 


Let me know if this helps.

@emerson,

I would suggest holding a number value to determine the number of touches total on the screen. When a touch event starts, it adds one to the touch count and decreases the touch count by one when it leaves. If there is one touch count, do a pan event, and if there is two do a zoom effect.

Let me know if this works for you. If not, please send some sample code so I can help with the current issue.
@Naomi,

I am still at work making this twitter client. There are a lot of things to check for authorization, but when I'm done with the module, you should only have to enter a few things to get it to work.

I don't want to release it until its complete, so I'm going take until the upcoming week to finish and make a tutorial on how to use it.
uid: 49520 topic_id: 20965 reply_id: 92680


[TOPIC: post.html]
#77

Emerson Hsieh

[GLOBAL: userInfoPane.html]
Emerson Hsieh
  • Contributor

  • 102 posts
  • Corona SDK

I tried it before but it didn't work Sorry:)

Then it did some web-searching andI came across this:

http://developer.anscamobile.com/code/pinch-zoom-xl

This gave me what I wanted, except that I want to apply it to the whole scene and get the physics ( and gameUI )working.

Heres what I got so far, the terminal kept saying that there is an error with it!!

I am still quite a newbie so the code (maybe, it seems nothing wrong with me) has many errors in it

www.geogamez.com/level1.lua

The code is too long to fit in this comment box, so I uploaded to my website's server instead
uid: 44110 topic_id: 20965 reply_id: 92754


[TOPIC: post.html]
#78

Emerson Hsieh

[GLOBAL: userInfoPane.html]
Emerson Hsieh
  • Contributor

  • 102 posts
  • Corona SDK

Never mind, got it working after a lot of attempts!

One more thing: is it possible NOT to let the user to pan to the edge of the scene?

And gameUI drag body doesn't work like before...(works weird)

Corona is awesome! I think I did the right move when I gave up on Objective-C

Code:

www.geogamez.com/level1%20new.lua
uid: 44110 topic_id: 20965 reply_id: 93232


[TOPIC: post.html]
#79

jamestimberlakejr

[GLOBAL: userInfoPane.html]
jamestimberlakejr
  • Enthusiast

  • 86 posts
  • Corona SDK

@emerson,

Cool! Glad it's resolved. And if you don't want the user to go past a certain part, you can put something in the panning event that prevents the screen from moving when the event.x and event.y property are above or below certain values. Let me know if t his works for you.
uid: 49520 topic_id: 20965 reply_id: 93289


[TOPIC: post.html]
#80

Emerson Hsieh

[GLOBAL: userInfoPane.html]
Emerson Hsieh
  • Contributor

  • 102 posts
  • Corona SDK

Well, I still quite a noob so I don't know how to do that. Could you please send me some code?Thanks

PS How about the Twitter Client?
uid: 44110 topic_id: 20965 reply_id: 94045


[TOPIC: post.html]
#81

se460

[GLOBAL: userInfoPane.html]
se460
  • Contributor

  • 104 posts
  • Corona SDK

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.
uid: 122802 topic_id: 20965 reply_id: 95651


[TOPIC: post.html]
#82

jamestimberlakejr

[GLOBAL: userInfoPane.html]
jamestimberlakejr
  • Enthusiast

  • 86 posts
  • Corona SDK

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.
uid: 49520 topic_id: 20965 reply_id: 104127


[TOPIC: post.html]
#83

Naomi

[GLOBAL: userInfoPane.html]
Naomi
  • Corona Geek

  • 2,303 posts
  • Corona SDK

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
uid: 67217 topic_id: 20965 reply_id: 104133


[TOPIC: post.html]
#84

Satheesh

[GLOBAL: userInfoPane.html]
Satheesh
  • Contributor

  • 732 posts
  • Corona SDK

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

Anyway,Really Awesome Work guys! Hats off!
Will try to contribute to this thread sometime :)
uid: 64174 topic_id: 20965 reply_id: 104135


[TOPIC: post.html]
#85

jamestimberlakejr

[GLOBAL: userInfoPane.html]
jamestimberlakejr
  • Enthusiast

  • 86 posts
  • Corona SDK

@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.

uid: 49520 topic_id: 20965 reply_id: 104138


[TOPIC: post.html]
#86

jamestimberlakejr

[GLOBAL: userInfoPane.html]
jamestimberlakejr
  • Enthusiast

  • 86 posts
  • Corona SDK

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.
uid: 49520 topic_id: 20965 reply_id: 104289


[TOPIC: post.html]
#87

emanouel

[GLOBAL: userInfoPane.html]
emanouel
  • Contributor

  • 119 posts
  • Corona SDK

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.
uid: 17701 topic_id: 20965 reply_id: 104308


[TOPIC: post.html]
#88

LairdGames

[GLOBAL: userInfoPane.html]
LairdGames
  • Contributor

  • 969 posts
  • Corona SDK

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)

-------------------------------

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 trueend------------   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
uid: 100814 topic_id: 20965 reply_id: 104313


[TOPIC: post.html]
#89

LairdGames

[GLOBAL: userInfoPane.html]
LairdGames
  • Contributor

  • 969 posts
  • Corona SDK

@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)
uid: 100814 topic_id: 20965 reply_id: 104315


[TOPIC: post.html]
#90

jamestimberlakejr

[GLOBAL: userInfoPane.html]
jamestimberlakejr
  • Enthusiast

  • 86 posts
  • Corona SDK

@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?
uid: 49520 topic_id: 20965 reply_id: 104317


[TOPIC: post.html]
#91

LairdGames

[GLOBAL: userInfoPane.html]
LairdGames
  • Contributor

  • 969 posts
  • Corona SDK

@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
uid: 100814 topic_id: 20965 reply_id: 104322


[TOPIC: post.html]
#92

jamestimberlakejr

[GLOBAL: userInfoPane.html]
jamestimberlakejr
  • Enthusiast

  • 86 posts
  • Corona SDK

@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.
uid: 49520 topic_id: 20965 reply_id: 104335


[TOPIC: post.html]
#93

LairdGames

[GLOBAL: userInfoPane.html]
LairdGames
  • Contributor

  • 969 posts
  • Corona SDK

@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.
uid: 100814 topic_id: 20965 reply_id: 104337


[TOPIC: post.html]
#94

jamestimberlakejr

[GLOBAL: userInfoPane.html]
jamestimberlakejr
  • Enthusiast

  • 86 posts
  • Corona SDK

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


[TOPIC: post.html]
#95

dgaedcke

[GLOBAL: userInfoPane.html]
dgaedcke
  • Contributor

  • 264 posts
  • Corona SDK

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


[TOPIC: post.html]
#96

idiot.dw

[GLOBAL: userInfoPane.html]
idiot.dw
  • Observer

  • 21 posts
  • Corona SDK

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
uid: 75910 topic_id: 20965 reply_id: 104415


[TOPIC: post.html]
#97

KenRogoway

[GLOBAL: userInfoPane.html]
KenRogoway
  • Contributor

  • 272 posts
  • Corona SDK

@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.
uid: 16734 topic_id: 20965 reply_id: 104437


[TOPIC: post.html]
#98

jamestimberlakejr

[GLOBAL: userInfoPane.html]
jamestimberlakejr
  • Enthusiast

  • 86 posts
  • Corona SDK

@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.
uid: 49520 topic_id: 20965 reply_id: 104571


[TOPIC: post.html]
#99

idiot.dw

[GLOBAL: userInfoPane.html]
idiot.dw
  • Observer

  • 21 posts
  • Corona SDK

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
uid: 75910 topic_id: 20965 reply_id: 104638


[TOPIC: post.html]
#100

dgaedcke

[GLOBAL: userInfoPane.html]
dgaedcke
  • Contributor

  • 264 posts
  • Corona SDK

@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.
uid: 6175 topic_id: 20965 reply_id: 104687



[topic_controls]
« Page 4 of 6 2 3 4 5 6
 
[/topic_controls]