Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Moebius

Copying assets as the program requires it would be useful.  At least this gives us a way to display our own splash screens.
If you can display a 'loading' screen at the start, you could make it just a xml android view, which allows the use of images put in one of the folders - so you could make it display "splash.png" or something like that, copied by GLB (like 'icon.png') on compile.
The problem I found earlier is that in order to display an android 'view', the initialising function where the files are currently copied has to finish first - so you need to find some way of moving it out of that.
Looking into this a while ago yes, all the media files are copied from the apk so they can be used as normal when you first run your app.

Unfortunately this happens within the code that starts up the app, causing the OS to leave the screen blank while all the files are copied...
I didn't have enough knowledge to work out how to call the copy media function from within GLB or at least after the app had started - it would be easy to display a splash screen if someone can figure out a way to call the copy media function from within GLB...

If someone can get that working, then it would be possible to modify the java code to save the files somewhere on the SD card with your program simply loading the media files from there.  For now you're stuck with the appearance of bloated data.
'(IBAction)'  just tells XCode's interface builder that it's a function it can use.  AFAIK just putting it in a c function should work - have you tried something like this?
Code (glbasic) Select
void _GLB_Launch_Feedback (void) {
    [TestFlight openFeedbackView];

and then in GLB:
Code (glbasic) Select
IMPORT "C" void GLB_Launch_Feedback()

Don't ask me why there's an underscore - I'm pretty much copying what trucidare did w/ the bluetooth wrapper...
you can try looking at
Managed to get a later version of android running on a galaxy S so I could run GLB apps thanks to that site.  The internal sd also got screwed over because the OS I installed was buggy... but that was just really unlucky...

EDIT:  Wait cancel that... doesn't look like they have anything for the I5700, but I could be wrong...
US citizens only?   ;/   Hope you're from the country of plenty.....
Thing is, I didn't accept anything or even install the software.....  :D
WOW  :rtfm:
I did read that scary license agreement before.  The thing that just scared me was clicking the "" opt out link.....   so many tracking cookies I never authorised......  :noggin:
Submitted a review (very smooth controls btw) but it still says 0 reviews?   :S  Guess Apple has to approve it first....  Easy to see how review-based marketing would work well in this system that effectively leaves your app on 0 stars until enough people rate it.....
I think Udacity's ex-stanford guys - following on from ai-class - there's also mitx being launched by MIT [naturally] and, following on from ml-class and db-class last year...
anyway they all look quite promising...
GLBasic - en / Re: New here
Yeah lol :P

You could just make it into a function actually:
Code (glbasic) Select
// BYREF means the variables you plug in will be changed by the function:
FUNCTION Collision:  BYREF x1, BYREF y1, BYREF x2, BYREF y2, BYREF vx1, BYREF vy1, BYREF vx2, BYREF vy2
// Collision code here

and that would work at lot more simply:
Code (glbasic) Select
Collision( Ball1x, Ball1y,  Ball2x, Ball2y,  Ball1vx, Ball1vy,  Ball2vx, Ball2vy )
just call it once for each pair of circles and that would work out rather nicely.
GLBasic - en / Re: New here
Here's code for circle to circle collisions (co-incidentally involved heavily in my current GLB project...)
given the positions and velocities of each "ball" it checks for collisions and calculates the new velocities.  It's not perfect, but as long as things aren't moving at very high speeds everything works out very close to perfectly (i.e. it looks VERY real I assure you):

Code (glbasic) Select
// (x1,y1) = coords of first ball.  (x2,y2) for second ball.
// (vx1,vy1) = velocity of first ball.  vx2, vy2 for second.

LOCAL dx, dy, d2
dx = x1 - x2
dy = y1 - y2
d2 = dx * dx + dy * dy

IF d2 < Size * Size

LOCAL d, ax, ay, vj1, vi1, vj2, vi2

d = SQR(d2)
ax = dx / d
ay = dy / d

//Calculate new velocities:
vi1 = ax * vx1 + ay * vy1
vi2 = ax * vx2 + ay * vy2
vj1 = ay * vx1 - ax * vy1
vj2 = ay * vx2 - ax * vy2

vx1 = ax * vi2 + ay * vj1
vx2 = ax * vi1 + ay * vj2
vy1 = ay * vi2 - ax * vj1
vy2 = ay * vi1 - ax * vj2

// Move balls away from each other (i.e. fix overlaps)
x1 = x1 + ax * (Size - d)
y1 = y1 + ay * (Size - d)
x2 = x2 - ax * (Size - d)
y2 = y2 - ay * (Size - d)


Of course, you'll need to make this work with arrays of types in order to handle multiple circles bouncing:

Code (glbasic) Select
TYPE Circle

LOCAL Circles[] AS Circle
DIM Circles[10]

And use ALIAS or change the variable names for the collision detection.....

Simple enough?   :P
It seemed that I'd have to root my phone in order to kill the app in order to get a stack trace....  long story short I ended up installing MIUI (android v2.3.7) and it doesn't crash anymore   :S
Still working on that (i.e. googling to fill in my lack of knowledge) but I do notice that one of these messages shows up in the log every few seconds after the app hangs:
Code (glbasic) Select
01-14 13:12:52.345 21165 21165 D dalvikvm: GC_EXPLICIT freed 70K, 53% free 2538K/5379K, external 0K/0K, paused 90ms
01-14 13:12:57.365  5431  5431 D dalvikvm: GC_EXPLICIT freed 42K, 53% free 2912K/6087K, external 0K/0K, paused 102ms
01-14 13:13:05.130  2965  2965 D dalvikvm: GC_EXPLICIT freed 55K, 47% free 3745K/7047K, external 0K/0K, paused 58ms

seems to go on indefinitely, a new logged message like this every few seconds, and not one of these shows up while the program is running normally.....
[Apologies in advance for the bump....]
Testing on a GS2 my game also hangs - seemingly randomly but at specific commands (specific ENDPOLYs and STRECHSPRITEs).  It only crashes whilst drawing to a virtual screen, and I haven't been able to find a logical explanation why.....
After a seemingly random number of loops, the first 'render' command after the USESCREEN seems to cause the program to hang.  The app doesn't crash, and when the back button is pressed the app exits and logs normally, but before then it seems stuck executing the command...
If it feels like it, the app sometimes waits until a later STRETCHSPRITE call before it crashes - always crashing at one of these two places...
I can't seem to replicate it in a simpler example, even with a massive loop of POLYVECTORs and STRETCHSPRITEs.   :giveup:  Any ideas as to why?   Could there be a hardware issue?  Is it possible for the drawing commands to get stuck like this?
A bit late, but I meant press F9 on that line ('DEBUG' is there for no particular reason...)