What is the
proper way to end a Corona program
when the home button is pressed?
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!
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
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: http://www.youtube.com/watch?v=vQiEcqSjmo8
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
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.
@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
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.
@James, I managed to tweak my platform code so it is ok now. Thanks for your generosity!
Joakim
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?
1
2
3
4
| if(ball.speed.x > 15 or ball.speed.y > 15) then
ball.speed.x = 15
ball.speed.y = 15
end |
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
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!
@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.
@jamestimberlakejr,
I've been doing something similar (helping out on the forums), but I like your approach. A direct offer to help.
I will offer the same thing. Anyone that needs help can contact me at: ken[at]homebrewsoftware[dot]com
I cannot promise to solve all questions, but I will do what I can to help out.
Also, if you've already asked james for help, I don't want to interfere in any support issues he is working on. Please ask ONE of us for help, not both of us unless the first person you ask says he doesn't have time.
In general I prefer to post solutions to problems here on the forums, so other users can learn too. However, if you have something you want kept private I will respect that as long as you let me know that upfront.
WOW @Ken, that`s amazing! Thanks James & Ken for offering free help! OMG it is awesome from both of you IMHO!
Cheers,
Rodrigo.
Hi jamestimberlakejr, thanks for all your availability, how i can send you the code?
Hi James .. great idea and offer
would you like to see this :
2 Questions regarding "Page Curl" :
http://developer.anscamobile.com/node/20435
thanks alot
@James,
I added two variables to get the current velocity.
In my onFrame event I was checking if they went to far and did a reverse of the "power" - but that made my player just bumping around uncontrolled. Do you think you can provide some small code samples?
Joakim
@Ken,
That's awesome. I'm glad that someone else is also doing this too. I'll send you an email.
@Blickon
You can send me your code at jamestimberlakejr[at]gmail[dot]com
@iAZZ
I'll take a look at it tonight and see what I can do.
@jk
I need to see the way you're doing it so I can point you into the right direction. Post me your code of how you're doing it and I can revise it. If you don't feel comfortable with that, then use email.
@Ken,
That's awesome. I'm glad that someone else is also doing this too. I'll send you an email.
@Blickon
You can send me your code at jamestimberlakejr[at]gmail[dot]com
@iAZZ
I'll take a look at it tonight and see what I can do.
@jk
I need to see the way you're doing it so I can point you into the right direction. Post me your code of how you're doing it and I can revise it. If you don't feel comfortable with that, then use email.
@Rc, Thanks. I really appreciate the support.
Hi, well I maybe looks stupid but I couldn't think of any other direction then this.
I putted it in onFrame event....
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
| --============================================================
-- FRAME LISTENER
--============================================================
local function onFrame()
Particles.Update()
--Check if game is running
if(isPlaying) then
--Check speed of player and put on brakes if he is going to fast...
vx, vy = ball:getLinearVelocity()
if(vx > 200) then
ball:applyLinearImpulse( -200, 0, ball.x, ball.y )
end
--Control camera movment
gameGroup.x = (ball.x * -1)+240
if(ball.y<250) then
if(ball.y>-100) then
gameGroup.y = ((ball.y * -1) +250)-5
ball.jumping = true
if gameGroup.y < 1 then
gameGroup.y=1
end
end
end
--Move the parallax
myParallax:setPosition(myParallax.position.x + lastBallX - ball.x, 0)
lastBallX = ball.x
lastBallY = ball.y
--Check if player is on moving platform - if so, make it follow
if attachedPlatform then
ball.x = ActivePlatform.x - PlatformOffset
ball.jumping = true
end
end
end |
@ jamestimberlakejr
Just sent you an email. Thanks!
@jk,
Why not try modifying the velocity of the object directly then?
1
2
3
4
| if(vx > 200) then
-- use zero to stop, -200 to go backwards
ball:setLinearVelocity( -200, vy )
end |
@James, that did the trick. Thanks!
Joakim
Hi james , here is the full code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
| -- hide the status bar
display.setStatusBar( display.HiddenStatusBar )
-- create example pages
local page1 = display.newImageRect( "page1.jpg", display.contentWidth, display.contentHeight )
page1:setReferencePoint( display.TopleftReferencePoint )
page1.x, page1.y = display.contentWidth*0.5, display.contentHeight*0.5
local page2 = display.newImageRect( "page2.jpg", display.contentWidth, display.contentHeight )
page2.x, page2.y = display.contentWidth*0.5, display.contentHeight*0.5
page2:toBack()
local page3 = display.newImageRect( "page3.jpg", display.contentWidth, display.contentHeight )
page3:setReferencePoint( display.TopleftReferencePoint )
page3.x, page3.y = display.contentWidth*0.5, display.contentHeight*0.5
page3:toBack()
local page4 = display.newImageRect( "page4.jpg", display.contentWidth, display.contentHeight )
page4.x, page4.y = display.contentWidth*0.5, display.contentHeight*0.5
page4:toBack()
local curlPage = display.newImageRect( "curlPage.png", display.contentWidth, display.contentHeight )
curlPage.x, curlPage.y = display.contentWidth*0.5, display.contentHeight*0.5
curlPage.isVisible = false
-- group to hold the page that will be turned (as well as the "curl" page)
local turnGroup = display.newGroup()
-- The following function will turn the page "back"
local function gotoPrevious( curlPage, time )
local time = time or 500
curlPage.isVisible = true
local hideCurl = function()
curlPage.isVisible = false
turnGroup:setMask( nil )
end
transition.to( turnGroup, {maskX=display.contentWidth*0.5+100, time=time } )
transition.to( curlPage, { rotation=45, x=display.contentWidth+(display.contentWidth*0.10)
, y=display.contentHeight + (display.contentHeight*0.25), time=time, onComplete=hideCurl })
end
-- The following function will turn the page "forward"
local function gotoNext( currentPage, curlPage, time )
-- add "pages" to page turning group
turnGroup:insert( currentPage)
turnGroup:insert( curlPage )
-- mask should match dimensions of content (e.g. content width/height)
local curlMask = graphics.newMask( "mask_640x960.png" ) -- iPhone portrait
--local curlMask = graphics.newMask( "mask_768x1024.png" ) -- iPad portrait
turnGroup:setMask( curlMask )
-- set initial mask position
turnGroup.maskX = display.contentWidth * 0.5+100
turnGroup.maskY = display.contentHeight * 0.5
-- prepare the page-to-be-turned and the curl image
currentPage:setReferencePoint( display.BottomRightReferencePoint )
curlPage:setReferencePoint( display.BottomRightReferencePoint )
curlPage.rotation = 45
curlPage.x = display.contentWidth+(display.contentWidth*0.10)
curlPage.y = display.contentHeight + (display.contentHeight*0.25)
curlPage.isVisible = true
-- show pagecurl animation and transition away (next page should already be in position)
local time = time or 500
transition.to( turnGroup, { maskX=-display.contentWidth*0.75, time=time } )
transition.to( curlPage, { rotation=0, x=0, y=display.contentHeight+20, time=time} )
curlPage.yScale = curlPage.y * 0.2
end
local function swipe(event)
local swipeLength = math.abs(event.x - event.xStart)
local currentPage = event.target
if event.phase == "moved" then
if event.xStart > event.x then
gotoNext (currentPage, curlPage, 1000)
elseif event.x > event.xStart then
gotoPrevious(curlPage,1000)
end
end
return true
end
page1:addEventListener( "touch" , function() gotoNext( page1,curlPage,1000 ) return true end )
page2:addEventListener( "touch" , swipe )
page3:addEventListener( "touch" , swipe )
page4:addEventListener( "touch" , function() gotoPrevious(curlPage,1000) return true end ) |
views:1875 update:2012/2/7 8:40:54
corona forums © 2003-2011