Posted: 16th Aug 2011 16:32
Mobiius should it be this?
+ Code Snippet
`Wait 3 seconds...
      StartTime# = GetTimer#
      Repeat
         Print( Str( StartTime# ) )
         Sync()
      Until timer() >= ( StartTime# + 3000.0 )
Posted: 16th Aug 2011 16:38
@Baxslash: GetTimer# = Timer() I just set GetTimer# to the Timer() once a loop so I only have to call it once. (I didn't include the updatescreen function which sets it for me.

And I've figured it out... It appears While Loops, and Repeat loops always evaluate as true, so quit immediately. If I replace them with a Do / Loop with an If X = Y then it quite as expected.

So, Fix the While and Repeat loops please!

*EDIT* Ok, so this loop works...
+ Code Snippet
Repeat
   UpdateScreen()
Until GetPointerPressed() = 1

But this loop doesn't...
+ Code Snippet
Repeat
   UpdateScreen()
Until Timer() >= OldTime# + 3.0

???
Posted: 16th Aug 2011 16:57
GetTimer# = Timer() I just set GetTimer# to the Timer() once a loop so I only have to call it once. (I didn't include the updatescreen function which sets it for me.

Maybe you were setting GetTimer# somewhere else in your loop but you aren't setting it anywhere in the repeat loop you posted... it wasn't being updated so GetTimer# had a constant value. I'm not being dumb.

I'm using while loops that work fine. Try putting this before any of your code it will be run as it should (just tried it):
+ Code Snippet
done=0
while done=0
    done=1
endwhile
Posted: 16th Aug 2011 20:05
When running an app, a bunch of image files are created and placed in the temp folder and are left behind (about 300K worth of files). The same group of files is duplicated with each unique app name/program. Without cleanup, this leaves behind quite a mess after running a lot of different code samples. The files left behind with each execute are:

Arial.png
Avenir.png
Button.png
ButtonDown.png
interpreter-backdrop.png
interpreter-logo.png
interpreter-power.png
interpreter-spinner.png
JoystickInner.png
JoystickOuter.png
Missing.png

Writing to a file appears to have problems. When loading and running the 'WritingToFile' sample app, the myfile.txt is created properly (in the same folder as the image files above), but the string written to the file includes several garbled characters prior to the string and a space character after the string, rather than properly writing just the specified string by itself.

Same issue as Mobiius, timer() doesn't seem to work with certain loop operations:

+ Code Snippet
tmm=Timer()
Repeat
   Sync()
Until Timer() > tmm + 3000
Posted: 16th Aug 2011 21:51
but the string written to the file includes several garbled characters prior to the string and a space character after the string


WriteString() will do this so that ReadString() can read it back again. You can use WriteLine() instead to write plain text data which will place a newline character on the end. This goes with ReadLine() which reads until a new line character is found.
Posted: 16th Aug 2011 22:57
Same issue as Mobiius, timer() doesn't seem to work with certain loop operations:

+ Code Snippet
tmm=Timer()
Repeat
   Sync()
Until Timer() > tmm + 3000


That snippit will wait 3000 seconds, change it to " + 3 " and it'll work. (Took me a while to figure that out silly me!)
Posted: 17th Aug 2011 2:34
WriteString() will do this so that ReadString() can read it back again. You can use WriteLine() instead to write plain text data which will place a newline character on the end. This goes with ReadLine() which reads until a new line character is found.


Ok, good to know, thanks!

That snippit will wait 3000 seconds, change it to " + 3 " and it'll work. (Took me a while to figure that out silly me!)


Ah yes, I noticed you pointed out that the problem is with the loops, not the timer itself (although a millisecond timer is important, is there one available?).
Posted: 17th Aug 2011 4:16
@Mobiius,

The timer is in seconds, and returns a float.

So if timer() - StartTime# = 3.0 that's 3 seconds.

if timer() - StartTime# = 0.5 that's 500 milliseconds.

NOTHING in AppGameKit updates, unless you use the Sync() command. That includes the timer().

So,

+ Code Snippet
StartTime# = timer()
do
   if timer() - StartTime# => 5.0 then exit
loop

Will run forever.

+ Code Snippet
StartTime# = timer()
do
   if timer() - StartTime# => 5.0 then exit
   sync()
loop

This will exit after 5 seconds.

Everything is relying on sync(). Even keyboard, button, touch, and accelerometer input.
Posted: 17th Aug 2011 10:02
I have a Sync() command in every loop. It's just hidden in the UpdateScreen() function and saved to the GetTimer# global.
Posted: 17th Aug 2011 14:13
if you load an image which is a 100% transparent png, it shows as a white block!

you have to at least put in 1 coloured pixel.
Posted: 17th Aug 2011 14:18
I think they should scrap the idea of saving temporary files in My Documents or wherever (depending on the device), and we just put a set of these files ourselves in the app folder together with our exe.

Also if we are not going to use the virtual joystick, we won't need the joystick media files, etc...

issing.png
Posted: 17th Aug 2011 16:48
One small thing, I have noticed the playsprite command doesn't seem to work by just using playsprite(tank), as an example. However it works ok when you specify speed and frame range aka PlaySprite(tank,10,0,1,4).
Posted: 17th Aug 2011 17:12
I have noticed the playsprite command doesn't seem to work by just using playsprite(tank)


Thanks, I've added a fix that should be in the next version.

I think they should scrap the idea of saving temporary files in My Documents


The location of the files is necessary due to restrictions on where applications are allowed to write files. Also since your app may produce output files with OpenToWrite that you want to keep, we can't clear out everything in the folder on closing.

To prevent the default images being written there you can include files that match those names in your resources folder and the AppGameKit will use those instead, and not write any to the write folder. (If you don't need to use them you can make them single pixel images to save space)
Posted: 17th Aug 2011 17:50
This would be an absolute perfect option!

So if my game does not save out any files, nothing is saved to My Documents on Windows.

To prevent the default images being written there you can include files that match those names in your resources folder and the AppGameKit will use those instead, and not write any to the write folder. (If you don't need to use them you can make them single pixel images to save space)
Posted: 17th Aug 2011 19:40
Edit - I'm not sure what I did extra, my gfx card did die on me so I had to reboot, but now the compiler works fine, no complaining about needing admin rights.
Posted: 18th Aug 2011 18:56
While trying to run app on Windows Server 2003 Standard, i get these error messages:
Failed to get bitmap bits for image: Avenir.ping at line 6

Failed to get bitmap bits for image: Ariel.png at line 6


Works fine on my windows 7 machine.
Posted: 18th Aug 2011 19:21
Have you tried installing the Visual Studio redistributable from http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=29
Posted: 18th Aug 2011 21:34
I just tried on a Server 2008 and received the same errors. VS 2008 C++ Redistibutable is already installed on the server 2008 box.
Posted: 19th Aug 2011 7:08
I set up 2 arrays with a dim of 50. I load data into the first array and then load data into the second array. My program crashes. I have determined that I can load the first array and the first entry of the second array without the crash. As soon as I try to load a second entry in the second array, the program crashes with no explanation. Any suggestions?
Posted: 19th Aug 2011 18:10
Getting text input seems to stop after about 25 characters -can't input more than that on windows - will the real devices allow more than that - scrolling input area, etc?