Menu

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 - spicypixel

#1
I lost this little snippet of code and although I could write it again it'd be nice to find. If any of you still have it I'd very much appreciate a copy  :nw:
#2
It would seem that it works when I use my own code. The art and sound assets are copied to the media folder within the relevant distribute.app sub folders. However it doesn't work when I try the included glb samples. I'm guessing its because they fail to utilise SETCURRENTDIR("Media") because this is the only thing I can imagine different.

Guess I fixed my own issue here :D
#3
I am using GLB v14. I have copied the platform files to the relevant program files sub directory within glb (although extracting the platform zips with 7zip was strange). However on compilation I get the relevant distribute.app folder and sub folders however there is no media in the files whatsoever????

This was the output from my Mac compile. Which seemed to compile but as I say no media in the media directory????

Code (glbasic) Select

_______________________________________
*** Configuration: OS-X_X86 ***
precompiling:
GPC - GLBasic Precompiler V.10.037 SN:429c3389 - 3D, NET
Wordcount:82 commands
compile+link:
cygwin warning:
  MS-DOS style path detected: C:\Users\tGerk\GLBasic\Samples\_Projects_\Pong\MacIcon.icns
  Preferred POSIX equivalent is: /cygdrive/c/Users/tGerk/GLBasic/Samples/_Projects_/Pong/MacIcon.icns
  CYGWIN environment variable option "nodosfilewarning" turns off this warning.
  Consult the user's guide for more details about POSIX paths:
    http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
Using icns type 'ic09' (ARGB) for 'C:\Users\tGerk\GLBasic\Samples\_Projects_\Pong\tmpMacIcon.png'
Saved icns file to C:\Users\tGerk\GLBasic\Samples\_Projects_\Pong\MacIcon.icns
Creating .app for Pong
run: "Q:\Tools\Icons.exe" "C:\Users\tGerk\GLBasic\Samples\_Projects_\Pong\icon.png" /MACOSX
success
_______________________________________
*** Finished ***
Elapsed: 10.3 sec. Time: 13:55
Build: 1 succeeded.
#4
I replaced the POW's with integers and all was fine :)
#5
The BSD formula just blatantly didn't work and alternated between 0 and 12345. The MS routine gave good PRNGs but needs some sort of seeding as the sequence was identical each time. It was good to see the generation of random numbers from a small algo though :)
#6
Good idea about the value of the POW to optimise calculations. I pretty much did what you have done there in my efforts by putting the MOD at the start, I think my only problem was not defining float or integer in the function name (I guess). Will test now my good friend. I believe the BSD pnrg is poor in comparison to the Microsoft method.

Results to be posted shortly :)
#7
This is a pseudo-random-number-generator which I'd really like to test out in GLB. My math knowledge is poor so thought I'd post this little function to see if anyone can answer my question regarding converting it to GLB. It's just the math section that needs doing really the results can be DEBUG output rather than printed (as per the example).

Code (glbasic) Select

//by default these are 0
global BSDState
global MSState

for i = 1 to 10
    print randBSD()
next

for i = 1 to 10
    print randMS()
next

function randBSD:
    randBSD = (1103515245 * BSDState + 12345) mod (2 ^ 31)
    BSDState = randBSD
endfunction

function randMS:
    MSState = (214013 * MSState + 2531011) mod (2 ^ 31)
    randMS = integer(MSState / 2 ^ 16)
endfunction
#8
There are a number of packers to allow running from a single executable. Programs like Molebox or App Compactor. However they are often given false positives in AV programs due to the way its packed in a virtual environment.
#9
AGK2 has Twitter and Facebook integration, Box2D as standard too. It's likely to integrate Win8 Mobile too I reckon. Presently it's my language of choice. Not that I don't check here daily though  :good:
#10
I use this.

Code (glbasic) Select

CONSTANT FRAMES_PER_SECOND% = 60
CONSTANT SKIP_FRAMES% = 1000 / FRAMES_PER_SECOND
CONSTANT MAX_FRAMESKIP% = 2


Code (glbasic) Select

FUNCTION GAME_LOOP:
    next_game_tick% = GETTIMERALL()
    LOCAL loops%
REPEAT
loops% = 0
WHILE( GETTIMERALL() > next_game_tick% AND loops% < MAX_FRAMESKIP%)
GAME_UPDATE()
next_game_tick = next_game_tick + SKIP_FRAMES
INC loops%
WEND
GAME_RENDER()
UNTIL (EXIT_LOOP% = TRUE)
ENDFUNCTION


I have functions for rendering and logic as you can see. The game loop function is initiated from my program state machine loop, and I return to my state machine when EXIT_LOOP% is true.

STATE MACHINE EXAMPLE
Code (glbasic) Select

WHILE Quit% = FALSE
SELECT APPSTATE%

CASE AS_TITLE_SCREEN% ; EXIT_LOOP% = FALSE ; TITLE_SCREEN()
CASE AS_SETTINGS% ; EXIT_LOOP% = FALSE ; SETTINGS_SCREEN()
CASE AS_LEVEL_SELECT% ; EXIT_LOOP% = FALSE ; LEVEL_SELECT_SCREEN()
CASE AS_GAME_OVER% ; EXIT_LOOP% = FALSE ; GAME_OVER_SCREEN()
CASE AS_CREDITS% ; EXIT_LOOP% = FALSE ; CREDITS()
CASE AS_SECRET% ; EXIT_LOOP% = FALSE ; SECRET()
CASE AS_HIGHSCORES% ; EXIT_LOOP% = FALSE ; HIGH_SCORE_TABLE()
CASE AS_HIGHENTRY% ; EXIT_LOOP% = FALSE ; HIGH_SCORE_ENTRY()
CASE AS_HOWTOPLAY ; EXIT_LOOP% = FALSE ; HOW_TO_PLAY()
CASE AS_GAME_LOOP% ; EXIT_LOOP% = FALSE ; GAME_LOOP()
DEFAULT ; Quit% = TRUE

ENDSELECT
WEND
#11
GLBasic - en / Re: Tweet
2015-Mar-26
Lack of modern features is the reason why GLB is dying. Generally developers working on keeping GLB alive seemingly have a distinct distaste of anything facebook/twitter/social related. Which is why I guess they don't feel these features are important. These features are not only important they're paramount.

I am working on a title presently but it will be my last GLB title. I'm going to move onto new languages which support, social, IAP etc... out the box.
#12
You need to install CrossDos on the Amiga so it'll read PC format disks. Then you can read the amiga floppies to a hdd on the Amiga and copy back to a PC format floppy
#13
Quote from: TheMapChap on 2015-Feb-08
Error 3 is usually due to keeping a file open when the program ends/crashes.

Again, nice to know which file. Error 3 is about as useful as "Error: Lentils"  =D
#14
Any news yet as to when GLB will emerge with the new iOS and Android fixes.
#15
Quote from: kanonet on 2015-Feb-02
Thats exactly what I do, thats why I said it would be pointless if the debugger would tell me at what codeline the loading failed - there is only one loading function in whole project. I think the debugger should simply tell the name+path of the file that he failed to load.

This is pretty much what I was referring to. I generalised by saying the code line, but as it's a file error, I did mean referencing the file that failed.