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.


Topics - Widget101

Pages: [1]
1
Announcements / Manic Miner GLB
« on: 2021-Aug-05 »
Hi All,

I've finished my GLB version of Manic Miner, linked below.(I say finished, it's probably a raw beta in real terms!)

Hadn't really intended to write it in the first place, it just grew from an article on crumbling platforms in Wireframe magazine. I've never coded a platformer before and it looked interesting.



I've attached a zip with the playable .exe and all the media but also put a copy of the GBAS file in the media folder if anyone is interested in looking through the code, pulling it apart, reusing, updating, correcting, laughing at it, etc.  ;)  (note its not refactored, so isn't efficient or streamlined!!)

Works for me without noticeable bugs but its not been extensively play-tested. Hope it works for you.

There's a readme in the folder which give a bit more detail, if you're interested.

Cheers,

Steve.

2
Hi,

I've drafted out a retro platformer (basically manic miner) and have an animated player but I'm finding that the pixel perfect collision is causing problems when my character walks off a wall. As he gets to the end of the wall he falls down as expected. However, as his arm extends back beyond his feet, the arm collides with the wall and the character sticks.

If I place a rectangular box under the sprite and use that for the collision then I don't get this problem as the edges of the collision check are always uniform (i.e. nothing sticking out past the edge to catch the wall).

Is there a way to replace the pixel perfect collision with a bounding collision instead? Or to make my rectangular box invisible so that it can't be seen but still detects collision.

Hopefully I've explained this clearly!! :S

Many thanks,

Steve.

3
Hi,

I'm trying to understand the best way to save and load data for my current game project which so far has just over 15600 variables in vars, dims and string$.

I think I'm ok with dims and the standard variables but am after a bit of advice for strings.

I've gone through the GLBasic help example but for some reason this comments out the key bit I'm after (// READSTR 1, x2$, LEN(xx$)).

I've managed to get it to work by saving the length of the string into the save file before saving the actual $tring as I can't otherwise see how it knows how long it has to be if its not already loaded it. I'm wondering if this is the best way to do it or whether there is a better solution. With this way every string in the save file is going to need its length saved before it so it can load the length into a variable then use that variable in the READSTR command to set the length for the text to follow it.

My simplified test code is below:
Code: (glbasic) [Select]
SETSCREEN 1024, 768, 1
SETFONT 0

//Set up some random variables
GLOBAL test$
GLOBAL var1
GLOBAL var2
GLOBAL var3
GLOBAL b$
GLOBAL var4
GLOBAL test[]
DIM test[5]

//populate the variables
test$ = "savefile.txt"
var1=57
var2=103
var3=999
b$="This Text String Could Be Any Length!!!!"
var4=345
test[0]=501;test[1]=602;test[2]=703;test[3]=804;test[4]=905

//create the save file
OPENFILE(1, test$, FALSE) //false=write mode
WRITEIEEE 1,var1
WRITEIEEE 1,var2
WRITEIEEE 1,var3
WRITEIEEE 1,LEN (b$) //saving the $tring length - is this required??
WRITESTR  1,b$
WRITEIEEE 1,var4
FOR f=0 TO 4; WRITEIEEE 1,test[f]; NEXT
CLOSEFILE 1

//Clear variables
var1=0
var2=0
var3=0
b$=""
var4=0
FOR f=0 TO 4; test[f]=0;NEXT

//See if they reload
//open the save file and populate the variables from it
LOCAL textlength
OPENFILE(1, test$, TRUE) //true=read mode
READIEEE 1, var1
READIEEE 1, var2
READIEEE 1, var3
READIEEE 1,textlength //load the length of the following text string
READSTR 1,b$,textlength //load the text string
READIEEE 1, var4
FOR f=0 TO 4; READIEEE 1,test[f]; NEXT
CLOSEFILE 1

//print the loaded variables to the screen
PRINT var1,0,0
PRINT var2,0,20
PRINT var3,0,40
PRINT b$,0,80
PRINT var4,0,120
FOR f=0 TO 4; PRINT test[f],0,140+f*20; NEXT

SHOWSCREEN

MOUSEWAIT


Any help would be appreciated.  :)

4
GLBasic - en / GLB Random Number Algorithm?
« on: 2020-Jun-07 »
Hi there,

Having spent far too long in Elite Dangerous and No Man's Sky I've been playing round with the SEEDRND and RND functions in GLBasic to create a super simple procedural galaxy (well, basically a matrix with repeatable numbers in it to represent stars) and am wondering what algorithm and 'period' GLB uses (if its not a secret!) as its basis??

:)



5
Hi there,

Just in the last week I've updated my virus/security software. I was using Bitdefender last year and renewed the subscription to the current Bitdefender total security 2018 however it's managed to destroy two reinstallations of GL Basic. Just this week I've re-downloaded GLBasic as a new install (though its carried by registration details across from somewhere!) but I'm having the same problem. Setting exceptions to my GLBasic install folder and separate projects folders doesn't seem to help.

I'm getting false positives on viruses and malware, still in my excluded projects folders and also in the user/temp folders that GLBasic uses when its compiling and running the code.

I'm wondering whether anyone else has had experience of this?

Many thanks,

Steve.

6
Hi there,

I've just encountered an error in my program which, when compiled is bringing up the following:
Code: (glbasic) [Select]
*** Configuration: WIN32 ***
precompiling:
GPC - GLBasic Precompiler V.10.037 SN:13d366d5 - 3D, NET
Wordcount:943 commands
compiling:
C:\Users\User\AppData\Local\Temp\glbasic\gpc_temp0.cpp: In function `int __GLBASIC__::__MainGameSub_()':
C:\Users\User\AppData\Local\Temp\glbasic\gpc_temp0.cpp:570: error: no matching function for call to `DIM(__GLBASIC__::DGStr&, int)'
D:/GLBasic/Compiler/platform/Include/glb.h:916: note: candidates are: void __GLBASIC__::DIM(__GLBASIC__::DGIntArray&, DGNat, DGNat, DGNat, DGNat)
D:/GLBasic/Compiler/platform/Include/glb.h:917: note:                 void __GLBASIC__::DIM(__GLBASIC__::DGNatArray&, DGNat, DGNat, DGNat, DGNat)
C:\Users\User\AppData\Local\Temp\glbasic\gpc_temp0.cpp: In function `DGInt __GLBASIC__::bumptext(__GLBASIC__::DGStr)':
C:\Users\User\AppData\Local\Temp\glbasic\gpc_temp0.cpp:4114: error: no match for call to `(__GLBASIC__::DGStr) (DGInt)'
C:\Users\User\AppData\Local\Temp\glbasic\gpc_temp0.cpp:4114: error: no match for call to `(__GLBASIC__::DGStr) (DGInt&)'
C:\Users\User\AppData\Local\Temp\glbasic\gpc_temp0.cpp:4124: error: no match for call to `(__GLBASIC__::DGStr) (int)'
C:\Users\User\AppData\Local\Temp\glbasic\gpc_temp0.cpp: In function `DGInt __GLBASIC__::textline()':
C:\Users\User\AppData\Local\Temp\glbasic\gpc_temp0.cpp:4161: error: no match for call to `(__GLBASIC__::DGStr) (DGInt&)'
*** FATAL ERROR - Please post this output in the forum
I'd set up a couple of functions (Bumptext and Textline) which receives a text string and adds it to a list which them moves it up the list as a new text string is received.

Bumptext moves the text string up the list and Textline just prints the 8 text lines to the screen each refresh:

Code: (glbasic) [Select]
FUNCTION bumptext: text$
FOR f=6 TO 0 STEP -1
displaytext$[f+1]=displaytext$[f]
NEXT
displaytext$[0]=text$
ENDFUNCTION

FUNCTION textline:
FOR f=0 TO 7
PRINT displaytext$[f],20,(20+f*20)
NEXT
ENDFUNCTION

Since getting the error I've tried remming out and removing the changes I made to the code, ignoring the commands and the functions that call them but its still crashing on every run which I'm struggling to understand as every change I've made should be ignored or undone.

Any help would be appreciated :)

7
GLBasic - en / Hi and Raspberry PI!
« on: 2016-Jan-20 »
Hi there,

I've just bought the full version of GLB after trying the demo out for (quite) a while and am really impressed with what it can do in 2d. Can't wait to see what the 3D is like.

I'm a huge fan of retro 8-bit games and systems but I've also recently got hold of a Raspberry PI and am wondering just how easy it is to write stuff in GLB that will compile to run on the PI.

Any help would be appreciated.

:)

Pages: [1]