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 1 of 6 1 2 3 »
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

jamestimberlakejr

[GLOBAL: userInfoPane.html]
jamestimberlakejr
  • Enthusiast

  • 86 posts
  • Corona SDK

Hey Everyone,

I've been using the Corona for a while and I want to take some of my time to contribute. Here's what I wanna do:

Each week, I'll take requests to either fix, critique, or write a set of code for an hour's worth of time, free of charge.

To submit your code or have any questions, respond in this post or message me with your issue.

-Happy Coding
JT
uid: 49520 topic_id: 20965 reply_id: 320965


[TOPIC: post.html]
#2

Danny

[GLOBAL: userInfoPane.html]
Danny
  • Corona Geek

  • 2,597 posts
  • Corona Staff

Very generous of you :) I'm sure many will avail of your offer
uid: 84637 topic_id: 20965 reply_id: 82794


[TOPIC: post.html]
#3

Ninja Pig Studios

[GLOBAL: userInfoPane.html]
Ninja Pig Studios
  • Contributor

  • 572 posts
  • Corona SDK

Awesome! That's very nice of you. Email me at ninjapig123 [at] gmail [.com].

Regards,
Jordan Schuetz
Ninja Pig Studios
uid: 29181 topic_id: 20965 reply_id: 82807


[TOPIC: post.html]
#4

Naomi

[GLOBAL: userInfoPane.html]
Naomi
  • Corona Geek

  • 2,303 posts
  • Corona SDK

OMG, James, this is an incredible offer. I just wouldn't want to waste this precious opportunity to get help, so I'll think very carefully about what help-request I'd make, but I sure will take up on your offer when I'm totally stuck.

Naomi
uid: 67217 topic_id: 20965 reply_id: 82809


[TOPIC: post.html]
#5

rarmstrong

[GLOBAL: userInfoPane.html]
rarmstrong
  • Observer

  • 29 posts
  • Corona SDK

Proper Facebook Friends List


This may be a bit ambitious for this request but I've been struggling with this problem for awhile now and I'm sure it would help tons of other people...

How would you go about creating a fleshed out Facebook friends list? Similar to this picture:


I'm able to make a basic list that pulls in the pictures and names of friends but I can't for the life of me figure out how to:

1. Sort the list alphabetically

2. Add the category rows so that only the letters show up in them (see how it shows B, C, D and E by themselves)

3. Implement a quick-scoll-esque legend on the right side of the screen
Again, this may be too much for an hour's worth of work but ANY help on the matter would be extremely appreciated :)

Thanks so much in advance for doing this! I can't wait to see what other requests come through here...
R
uid: 47361 topic_id: 20965 reply_id: 82840


[TOPIC: post.html]
#6

MrMells

[GLOBAL: userInfoPane.html]
MrMells
  • Enthusiast

  • 75 posts
  • Corona SDK

I have to admit that if you could take a quick look at my documented issue,
that would greatly help me.

-> attempt to call method 'move' (a nil value)

uid: 95346 topic_id: 20965 reply_id: 82844


[TOPIC: post.html]
#7

jamestimberlakejr

[GLOBAL: userInfoPane.html]
jamestimberlakejr
  • Enthusiast

  • 86 posts
  • Corona SDK

@Everyone,
Thanks for the support! I'm happy to help and I can't wait to see the interesting cases that come from it!

Speeking of cases....

@R,
I'll see how much I can do and keep you informed. What's the code for the kind of view you're using to make your facebook page? I want to make sure what I'm writing is an easy plug and play for what you have.

@Mells
I'll take a look at it and update you when I'm done
uid: 49520 topic_id: 20965 reply_id: 82850


[TOPIC: post.html]
#8

MichaelAssadi

[GLOBAL: userInfoPane.html]
MichaelAssadi
  • Contributor

  • 246 posts
  • Corona SDK

Hey,

Thanks for doing this! I would love for someone to help me with my problems :)

My email is: michaelas@eb.org

Thanks!

- Michael
uid: 23689 topic_id: 20965 reply_id: 82859


[TOPIC: post.html]
#9

jamestimberlakejr

[GLOBAL: userInfoPane.html]
jamestimberlakejr
  • Enthusiast

  • 86 posts
  • Corona SDK

@Mells
When you call the function setmetatable, it erases the other metatable and replaces it with the most recent one. It's usually used for assigning one 'class'. In order to do proper multiple inheritances, you would need to do a more programming and it gets a bit complicated. Instead I use a simpler method for inheritance that is almost identical to what someone linked to on your forum post:

main.lua

--NEVER USE GLOBAL OBJECTS. ALWAYS STORE THINGS LOCALLYlocal Balls_Class = require ("balls")require ("libraries") local Game = {}  function Game:startSetup()              local listBalls = Balls_Class.newBalls()                                    print (listBalls[1].x) -- Displays "400", great until there         listBalls[1]:move(50) -- Doesn't work.How can I access function move() in ball.luaend Game:startSetup()


balls.lua

module(...,package.seeall)--CREATE A CLASS THAT REFERENCES THE BALL CLASS. ITS ONLY USED IN THE BALLS CLASS SO NO NEED FOR IT IN THE MAIN FILE--ALWAYS RETURN A LOCAL OBJECT OR YOU WILL POLLUTE YOUR GLOBAL SPACE!!!!local Balls_Class = {}  local Ball_Class = require('ball')    function Balls_Class:newBalls()       -- ----------------------------------------- GO STRAIGHT INTO MAKING THE LIST TABLE. NO NEED FOR A SETUP-- ---------------------------------------		local listBalls = {}		        -- Set Balls Defaults        local params = {                { radius=20, xdir=1, ydir=1, xspeed=2.8, yspeed=6.1, r=255, g=0, b=0, posx=400, posy=150 },                { radius=50, xdir=-1, ydir=-1, xspeed=1.8, yspeed=1.5, r=115, g=23, b=33, posx=200, posy=200},                { radius=20, xdir=1, ydir=1, xspeed=2.8, yspeed=6.1, r=255, g=0, b=0, posx=400, posy=350 }        }         for i, j in pairs(params) do        print(j.radius)        		local param = j                local ball = Ball_Class:newBall(j)                       table.insert(listBalls, ball)                --ball = nil        end         return listBalls        end --RETURNING THE BALL CLASS SO THE VARIABLE INHERITS THE OBJECTS FUNCTIONSreturn Balls_Class


ball.lua
module(...,package.seeall)---THIS CLASS HOLDS ALL FUNCTIONS FOR CREATING THE BALLlocal Ball_Class = {}  function Ball_Class:newBall(params)        local default_xpos = display.contentWidth*0.5        local default_ypos = display.contentHeight*0.5                -- Create Display Object for Ball       local Ball = display.newCircle(default_xpos, default_ypos, params.radius )                 function Ball:move(dist)        	print ("Move Ball")      		 self.x = self.x + dist -- example of accessing a property        	self:setFillColor(128,0,0)		end               return Ballendreturn Ball_Class


This method is much simpler for making classes and you can perform multiple levels of inheritance without calling every class in the main file.

Side Note: Try not to pollute your global namespace. Use more local variables because it maintains your programs speed and helps in memory management.

Let me know if this helps.

-JT
uid: 49520 topic_id: 20965 reply_id: 82867


[TOPIC: post.html]
#10

MrMells

[GLOBAL: userInfoPane.html]
MrMells
  • Enthusiast

  • 75 posts
  • Corona SDK

Thank you very much JT, I could achieve what I was expecting :)
The comments were really helpful.

I might have something more to ask if it's ok, but I'm not sure if I should post my questions here or in my own thread?
I am trying to learn from lua-users and would love to see the way you would do the following with my example :
In order to do proper multiple inheritances, you would need to do a more programming and it gets a bit complicated

I do understand the reasons why you are advising me that simple way to achieve things and I will clearly use it in the future.

But I'd also like to know how to do it "the other way" if possible.

My reasons are that :
1. most part of the docs at lua-users use metatables and I'm ok to learn things the hard way today if this is a wise time investment for later
2. it seems that there were a lot of things said against the use of package.seeall and advised by Ansca.
I believe that the tutorials in the future will take that in account, so I would like to be able to follow and understand it.

I believe that learning how to do things with metatables is a wise investment and the exercise I'm doing with (Balls) is a good one for a start?

I don't want to take so much of your time so :
- Would please you help me learn how to use metatables and do multiple inheritances in my exercise?
- Or point me to the correct way of learning about it so I can complete my exercise?

Any help would be greatly appreciated, thanks again JT for taking the time.
uid: 95346 topic_id: 20965 reply_id: 82880


[TOPIC: post.html]
#11

jamestimberlakejr

[GLOBAL: userInfoPane.html]
jamestimberlakejr
  • Enthusiast

  • 86 posts
  • Corona SDK

Learning multiple inheritance is good to know for using lua, but probably not worth the trouble for using corona. Not sure if you can see how the code works under the hood of the SDK and you may be conflicting certain ideologies that the code is based on. I choose that way for Corona because:
A. It's easy to implement
B. Maintains the integrity of the object I'm working with

If you would like to know more about multiple inheritance, you can definitely start with this:
http://lua-users.org/wiki/SampleCode
uid: 49520 topic_id: 20965 reply_id: 82902


[TOPIC: post.html]
#12

Rob Haney

[GLOBAL: userInfoPane.html]
Rob Haney
  • Enthusiast

  • 83 posts
  • Corona SDK

JT,

Your offer sounds great!! Would you consider helping me make some modifications to some code Carlos created....the following link is to the code.

http://developer.anscamobile.com/code/bezier-object-along-curves-path

This is what I need and I have spent four days reading though docs and example code.

I want to make an object follow a predetermined path(s) with the option select a choice to make a change in direction along the path to another path.

I want this to run with a user "touch" event (via a button/slider) listener with increase-able/decrease-able speed; not at the enterFrame Runtime.

I know I can make an object go from point A to B via a transition.to however; I am looking for something to be able to follow a line that potentially has an "S" curve in it.

Rob Miracle suggest the use of a Table; I have reviewed the code from the link above and almost have a handle on it. But instead of picking four point on the screen to place the curve or path. I just want to be able to "set" the path with the speed slider on the screen to make my object accelerate.

If this is asking for too much I understand; but the concept of Tables is making me nutz right now. I need a working example to be able to break it down to something I understand.

Thanks a million.
Rob
uid: 16527 topic_id: 20965 reply_id: 82906


[TOPIC: post.html]
#13

MrMells

[GLOBAL: userInfoPane.html]
MrMells
  • Enthusiast

  • 75 posts
  • Corona SDK

Edit : I found why I couldn't achieve such a basic thing :
It's not possible to set the metatable of display objects
ok, I got that when I do :
local new_inst = display.newCircle(default_xpos, default_ypos, default_radius )new_inst.note = 20return setmetatable(new_inst, Ball_mt)

and
local ball = Ball_Class.new(param)

then
print (ball.x) -- nilprint (ball.width) -- nil  But isn't ball a displayObject?print (ball.note) -- 20


I found a thread talking about that, I post here for those who might need a solution :
Inheriting a display object
Thank you again for your help and good luck on your own projects!
uid: 95346 topic_id: 20965 reply_id: 82907


[TOPIC: post.html]
#14

mobilefun4me

[GLOBAL: userInfoPane.html]
mobilefun4me
  • Enthusiast

  • 48 posts
  • Corona SDK

What is the

proper way to end a Corona program

when the home button is pressed?
uid: 6288 topic_id: 20965 reply_id: 82934


[TOPIC: post.html]
#15

mobilefun4me

[GLOBAL: userInfoPane.html]
mobilefun4me
  • Enthusiast

  • 48 posts
  • Corona SDK

Corona Simulator[3092:903] Connection error: (corona.update2)



When running the debugger on all of the last 6 releases I receive this message:

Ansca Corona Remote Debugger
Run the program you wish to debug
2012-01-27 12:40:47.620 Corona Simulator[3092:903] Connection error: (corona.update2) fault(Token has expired.)
2012-01-27 12:40:47.624 Corona Simulator[3092:903] Connection error: (corona.update2) ({
"/FaultCode" = 1;
"/FaultString" = "Token has expired.";
"/kWSHTTPResponseMessage" = "{url = http://developer.anscamobile.com/services/xmlrpc; status = HTTP/1.1 200 OK}";
"/kWSResultIsFault" = 1;
})

I can't seem to get an answer on this and am not knowing if this affects anything else that might lead to problems.

I am on Snow Leopard 10.6.8

Thanks!
uid: 6288 topic_id: 20965 reply_id: 82973


[TOPIC: post.html]
#16

jkrassman

[GLOBAL: userInfoPane.html]
jkrassman
  • Contributor

  • 573 posts
  • Corona SDK

Oh, this is so fantastic - a pro developer offer he's valuable time to help us.

I am in the end of my first game development - its a classic platform game. All gameplay is almost done and the rest is just leveldesign. One thing that I am not that happy with is the attachment of the player to my moving platforms. The game is running in physics mode, so the weight of the player makes him just slip of the platform. I managed to solve this issue but I am not 100% satisfied with the result.

There are a lot of fragments of code in several of listeners and functions. Do you have time to help me look at it? If so, should I post all of my fragments here or what is the best solution?

Best regards, Joakim - Sweden
uid: 81188 topic_id: 20965 reply_id: 82993


[TOPIC: post.html]
#17

Blickon

[GLOBAL: userInfoPane.html]
Blickon
  • Contributor

  • 269 posts
  • Guests

Hi jamestimberlakejr, this is a great help to us, thanks for the availability, I have a question that I have some doubts and is the most important part of my application, i am trying to create a object like that:

see the elastic effect of the object, the green elastic. i tried to use joints but it isnt good because when i pull the joints will separate a little, how i can create some like it? what i should use etc

Thanks jamestimberlakejr
uid: 26056 topic_id: 20965 reply_id: 83013


[TOPIC: post.html]
#18

jamestimberlakejr

[GLOBAL: userInfoPane.html]
jamestimberlakejr
  • Enthusiast

  • 86 posts
  • Corona SDK

Wow! Awesome requests so far everyone. I should have some results for these by tomorrow.
P.S. @R Please provide me with the code you're using to make your tableview so I can modify it. I want to make the code fit like a glove on your existing project.
uid: 49520 topic_id: 20965 reply_id: 83020


[TOPIC: post.html]
#19

jamestimberlakejr

[GLOBAL: userInfoPane.html]
jamestimberlakejr
  • Enthusiast

  • 86 posts
  • Corona SDK

@Rob Haney,

I'm not sure what you mean by "set"? Do you mean have the user use their finger to draw the path?

@Moilefun,
Could you specify a bit more? I'm not sure if you're talking about an application or the simulator or the sdk itself.

@JK,
I don't know what your code looks like, but try increasing the friction of the surface of the platform. Show some code on here and I'll see what I can come up with
uid: 49520 topic_id: 20965 reply_id: 83320


[TOPIC: post.html]
#20

mobilefun4me

[GLOBAL: userInfoPane.html]
mobilefun4me
  • Enthusiast

  • 48 posts
  • Corona SDK

This happens when I run the debugger from within the Corona SDK folder on my (2008) MacBook Pro.

Steps to recreate problem:
1). Open the SDK folder in the Applications Folder. Corona version: 2012.731 (2012.12.8) on my Mac
2). Double click the debugger program.
3.) View error messages in terminal window.
4.). Note: I can run any programs I want.
5.). Note: I can build for device.

uid: 6288 topic_id: 20965 reply_id: 83334


[TOPIC: post.html]
#21

jkrassman

[GLOBAL: userInfoPane.html]
jkrassman
  • Contributor

  • 573 posts
  • Corona SDK

@James, I managed to tweak my platform code so it is ok now. Thanks for your generosity!

Joakim
uid: 81188 topic_id: 20965 reply_id: 83360


[TOPIC: post.html]
#22

jkrassman

[GLOBAL: userInfoPane.html]
jkrassman
  • Contributor

  • 573 posts
  • Corona SDK

Ok, this one is maybe an easy one?

Is there something I can do by code in the event onFrame to "slow down" my moving player in the physics world?

if(ball.speed.x > 15 or ball.speed.y > 15) then
 ball.speed.x = 15
 ball.speed.y = 15
end
uid: 81188 topic_id: 20965 reply_id: 83369


[TOPIC: post.html]
#23

Rob Haney

[GLOBAL: userInfoPane.html]
Rob Haney
  • Enthusiast

  • 83 posts
  • Corona SDK

JT,

Basically I would like to have 3-4 predetermined paths. All starting with the same segment then have a "fork-in-the-road".

At the point of the "intersection" i want the user to pick the direction they we to go. ....

With this, i need to know how to go forward & reverse repeatedly; changing the "intersection" choice at will.

(also if the try to travel past the intersection without changing it the object will crash/explode.

Is this something that can be done without physics? I am not sure I want to tackle that yet.

If this is too much I completely understand. Maybe if you wouldn't mind you can guide/Tutor me along the way.

Thanks for your assistance and direction.
Rob
rob at katnapapps [dot] com
uid: 16527 topic_id: 20965 reply_id: 83387


[TOPIC: post.html]
#24

rarmstrong

[GLOBAL: userInfoPane.html]
rarmstrong
  • Observer

  • 29 posts
  • Corona SDK

Hey James,

sorry for the late response but I'm having a rough time figuring out how to send you a private message or email... Can you provide me your email address or let me know how to send you a pm and I'll send along my lua file.

Thanks so much for this!
uid: 47361 topic_id: 20965 reply_id: 83416


[TOPIC: post.html]
#25

jamestimberlakejr

[GLOBAL: userInfoPane.html]
jamestimberlakejr
  • Enthusiast

  • 86 posts
  • Corona SDK

@Mobilefun
That's never happened to me and I can't reproduce this issue. I'm really not sure how to tackle that one until I can at least recreate it. Is there something you may have done to create it?
@Blickon
I don't think there's a way right now to stop the separating effect because it would involve modifying the pixels of the graphics. The methods I can think of right now is trying to mask the "breaking" effect you get from the joints. I would suggest trying to use smaller joint objects at a higher number for your elastic effect.

That should make the the "breaking" effect look less obvious ( but I'm not sure how it will affect your performance ). If you have some code that you are already working on, let me see it and I could test it for you.

@jk
Sure. If you are using physics, you can set an impulse force negative to the current velocity that the player has. If your speed is done by moving it through the x and y coordinates, keep a universal variable that you use to determine speed and do subtraction on it based on the event frame.

Also, if you're using animations and you want the effect of the animation slowing down, you can use the timescale property sprites have that determine their animation speed ( 1 is default ). Let me know if this helps.
@Rob
You can do this without physics, but you will probably run into performance issues because you want to do checks based on where the player is, but if you'd like to try, you can make an event listener that always runs and in it you translate the x and y coordinates along the path you want.

My advice would be to have the paths you have in that link, but have them set up with invisible checkpoint objects equally along the path. When the person signals to take a turn, you make a check to determine the current location of their car along a given path. If there is a checkpoint nearby, they become jointed to that and the checkpoint runs the path with the object being dragged along with it. When the person detaches from the checkpoint, the checkpoint goes back to its original position and you can select it again.

Going forward and reverse would be based on a value belonging to the persons car. When the car attaches to the checkpoint, the checkpoint checks if the car wants to go forward or backward. If forward, then the checkpoint moves to the next highest part of the path and vice versa.

I know this is a lot, but if you need any more assistance while making the code or need any more clarification, please let me know.

@Ram
If you need to send me your code, please send it at jamestimberlakejr[at]gmail[dot]com for your code submission, but make sure to post here so I know to check.

uid: 49520 topic_id: 20965 reply_id: 83466



[topic_controls]
Page 1 of 6 1 2 3 »
 
[/topic_controls]