GLBasic forum

Main forum => GLBasic - en => Topic started by: backslider on 2010-Aug-02

Title: iPhone Compiling Problem?!
Post by: backslider on 2010-Aug-02
Hi guys,

today i compiled my first 2 Apps for the iPhone...
The touch demo from the showplace is running fine, but when i compile my own project:

->the app starts (blackscreen)
->the app ends
->compiler says, that the app ended normally.

But i want to play my game and not a blackscreen xD
Does sb. know where the problem could be?

thanks!
Title: Re: iPhone Compiling Problem?!
Post by: trucidare on 2010-Aug-02
GLB-Error: 9
Title: Re: iPhone Compiling Problem?!
Post by: Kitty Hello on 2010-Aug-05
No WHILE/WEND loop?
Title: Re: iPhone Compiling Problem?!
Post by: backslider on 2010-Aug-05
On PC the game is running ;)
Title: Re: iPhone Compiling Problem?!
Post by: Slydog on 2010-Aug-05
Since it ends early, I'd start there.
It may also explain the black screen.

Write some logs to a file in the "DOCUMENTS" folder at various points in your code to see how far it makes it.
Do you have any device specific compiler directives (for the PC or iPhone)?
Title: Re: iPhone Compiling Problem?!
Post by: Kitty Hello on 2010-Aug-05
you can use STDOUT on iPhone to write to the debugger console.
Title: Re: iPhone Compiling Problem?!
Post by: Slydog on 2010-Aug-05
That sounds easier, I've never used it.
I would have assumed that the 'debugger console' would only work when running in Simulation mode.
Nice to know.
Title: Re: iPhone Compiling Problem?!
Post by: backslider on 2010-Aug-06
OK, I found the problem with STDOUT (very nice command!). The size of my Mousearray was to small (on pc you can´t test it :D) and now I sized it with "DIM mouse[GETMOUSECOUNT()]".

But now I have another question and I don´t want to create a new Thread for that.
In my game you have to move objects with the fingers, but When I touch the object
it pushes with highspeed align the x-axis out of the screen.

I use the command "object.pos.x%,INC MOUSEAXIS(0)" and on PC it works fine.
Hope you can help me :)
Title: Re: iPhone Compiling Problem?!
Post by: trucidare on 2010-Aug-06
touch the iphone screen is like to click the mousebutton.
Title: Re: iPhone Compiling Problem?!
Post by: Slydog on 2010-Aug-06
You could try using the 'MOUSESTATE' command instead.
It uses absolute mouse coordinates, instead of relative / velocity.

That is of course if you what the object to follow your finger exactly, and not to push it in a direction.

[Edit]
Use with 'SETACTIVEMOUSE' to choose what finger to follow.
Title: Re: iPhone Compiling Problem?!
Post by: matchy on 2010-Aug-06
Here's my generic current mouse array fill:

Code (glbasic) Select

TYPE objMouse;x;y;b1;b2;b1last;b2last;xaxis;yaxis;xlast;ylast;xaxislast;yaxislast;xjoy;yjoy;zjoy;xoff;yoff;zoff;ENDTYPE
GLOBAL oMouse[] AS objMouse,mice

mice=GETMOUSECOUNT()-1

/////

FUNCTION funMouse:
LOCAL iMouse,iMX,iMY,iMAxisX,iMAxisY,iXJoy,iYJoy

// iMouse=oPlatform[0].mouse
// FOR iMouse=0 TO mice-1
// FOR iMouse=0 TO mice-1
// FOR iMouse=0 TO 1
iMAxisX=MOUSEAXIS(0)
iMAxisY=MOUSEAXIS(1)
FOR iMouse=mice-1 TO 0 STEP -1
oMouse[iMouse].b1last=oMouse[iMouse].b1
oMouse[iMouse].b2last=oMouse[iMouse].b2
oMouse[iMouse].xaxislast=oMouse[iMouse].xaxis
oMouse[iMouse].yaxislast=oMouse[iMouse].yaxis
oMouse[iMouse].xlast=oMouse[iMouse].x
oMouse[iMouse].ylast=oMouse[iMouse].y
SETACTIVEMOUSE iMouse
MOUSESTATE iMX,iMY,oMouse[iMouse].b1,oMouse[iMouse].b2
iXJoy=GETJOYX(iMouse)
iYJoy=GETJOYY(iMouse)
IF iMouse=0
oMouse[iMouse].xaxis=iMAxisX
oMouse[iMouse].yaxis=iMAxisY
oPlatform[0].xjoy=iXJoy
oPlatform[0].yjoy=iYJoy
ENDIF
SELECT oPlatform[0].angle
CASE 0
oMouse[iMouse].x=iMX
oMouse[iMouse].y=iMY
oMouse[iMouse].xjoy=iXJoy
oMouse[iMouse].yjoy=iYJoy
CASE 90
oMouse[iMouse].x=oPlatform[0].sw-iMY
oMouse[iMouse].y=iMX
oMouse[iMouse].xjoy=iYJoy
oMouse[iMouse].yjoy=iXJoy
CASE 180
oMouse[iMouse].x=oPlatform[0].sw-iMX
oMouse[iMouse].y=oPlatform[0].sh-iMY
oMouse[iMouse].xjoy=-iXJoy
oMouse[iMouse].yjoy=-iYJoy
CASE 270
oMouse[iMouse].x=iMY
oMouse[iMouse].y=oPlatform[0].sh-iMX
oMouse[iMouse].xjoy=-iYJoy
oMouse[iMouse].yjoy=-iXJoy
ENDSELECT
// IF oMouse[iMouse].b1last=0 AND oMouse[iMouse].b1=1
// oMouse[iMouse].xlast=oMouse[iMouse].x
// oMouse[iMouse].ylast=oMouse[iMouse].y
// ENDIF
// IF oMouse[iMouse].b2last=0 AND oMouse[iMouse].b2=1
// oMouse[iMouse].xlast=oMouse[iMouse].x
// oMouse[iMouse].ylast=oMouse[iMouse].y
// ENDIF
oMouse[iMouse].zjoy=GETJOYZ(iMouse)
NEXT
// SETACTIVEMOUSE 0
ENDFUNCTION


:enc:
Title: Re: iPhone Compiling Problem?!
Post by: backslider on 2010-Aug-06
Yes I´m using SETACTIVEMOUSE because I need 2 or 3 fingers ;)
The fingers are not the problem.

OK then I will try it with MOUSESTATE and not MOUSEAXIS(0) ... Shouldn´t be a big problem.

Thanks

P.S. Your function looks nice matchy :) When I´m at home i will try some things ;)