Recent Posts

Pages: 1 2 [3] 4 5 ... 10
21
GLBasic - en / Re: 3D and GLB
« Last post by bigsofty on 2020-Oct-17 »
I'd definitely be interested in some 3d tutorials. It's the old retro style 3d that interests me most so basic graphics and shading is no problem providing the speed is there.

One of the projects on my list is to remake the old Zarch / Virus game that David Braben wrote for the Archimedes. I'd made a start on this in DarkBasic before I moved across to GLBasic. Plan has always been able to see if I could get it up and running in GLB.


[/youtube]

Great choice for a remake, I have many fond memories playing Virus on my ST.  :happy:
22
GLBasic - en / Re: 3D and GLB
« Last post by Widget101 on 2020-Oct-17 »
I'd definitely be interested in some 3d tutorials. It's the old retro style 3d that interests me most so basic graphics and shading is no problem providing the speed is there.

One of the projects on my list is to remake the old Zarch / Virus game that David Braben wrote for the Archimedes. I'd made a start on this in DarkBasic before I moved across to GLBasic. Plan has always been able to see if I could get it up and running in GLB.


[/youtube]
23
GLBasic - en / Re: Returning GLBasic user questions :)
« Last post by retrogren on 2020-Oct-17 »
Cheers for that.  Might have a look at Anim8or later.

I've actually done a quick tutorial on Blender today; for absolute beginners!   Basically it was an introduction to the interface, and how to create/manipulate basic objects.
After creating a simple cube I played with the export settings - saving it as .OBJ.
Then I used the IDE tool Convert3D to create a .DDD version of the file and started playing with loading the object into OpenGL.  After a bit of fiddling with scale and X_movement I got it to display nicely in my maze, and was quite impressed with how straightforward it all was!

Of course the next step is something a little more complex, but this has definitely whetted my appetite  :)

Thanks for all the suggestions.
24
GLBasic - en / Re: Android Saving Files
« Last post by MrPlow on 2020-Oct-17 »
Thanks Gernot
Ideally I would want the image saved to Gallery on the Android device...but if that's not possible then knowing where to find the image is key...
25
Thank you!

That is much better - doesn't need to separately worry about the length of the text.

Code: (glbasic) [Select]
c$="A random line of text!"
WRITELINE 1,c$ //to write the text line to the file
READLINE 1,c$ //to read the text from the file back into the variable

Many thanks.
26
An easy way would be writeline for each variable. Otherwise you write a binary file. So first must be a file format nilumber to read older versions..
27
GLBasic - en / Saving and Loading Game Data Text String$
« Last post by Widget101 on 2020-Oct-17 »
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.  :)
28
2D-snippets / PlyTxt - Polygon Text TXT files
« Last post by Kitty Hello on 2020-Oct-17 »
Sometimes, I need vector graphics - polygons.
And designing them is always complicated. Most times, I just need 10 points.
So, I decided to make a vector format, that is editable with any text editor.

The file format is described in "Media/fileformat.plxtxt" and goes like:

#plytx - 5 byte header information. File encoding without BOM!

# --= PolyText ==-
# Polytext is a vector format, that is easy to edit
# with a text editor.

# *** SYNTAX ***
# Everything right of a '#' is considered a comment.
# lines starting with ':' are commands. Commands must be lowercase.
# whitespace between command arguments is ignored.
# arguments can be separated by whitespace. Comma ',' is treated as whitespace
# for better readability.

# *** NODES ***
# The point information is given in the 'map' command.
# Points are named:
#         0..9 A..Z a..z
# This results in max. 62 points per file.
# The above point names also are the default order of the point names.
# Point names can have gaps, so you can easily define a polygon
# by the points A C E and refer to the names range A-E.
#
# ^Y     The name '0' is a special point and refers to the origin
# |      of the local coordinate system.
# 0-->X  X positive is to the right, Y positive is towards the top.

# *** SPECIAL NODES ***
# You can embrace nodes by (), [], {} or <>
# These points get a special tag when importing them.
# It does not matter if you only write one brace, like (X or X),
# or both (X) braces.
# Also, you can set multiple braces for one point:
# {(X]> # this would set all 4 brace flags for the point 'X'.
# ASCII-art characters can be used to indicate connected lines.
# The following characters are valid:
# - + . _ / \ ^ : , ´ ` '
# The following characters are reserved for the future:
# " * ! ? & % $ §

################## COMMANDS #########################################
# *** FONT ***
# :font w h
# specify the font width and height ratio, because most text editors
# do not use quare fonts. For 'Consolas' this is like 7 18

# *** ORIGIN ***
# :origin orgx orgy
# A corrdinate that represents the position of node name '0'.
# Defaults to 0 0

# *** SCALE ***
# :scale factorx [factory]
# A factor that is applied to the X and Y coordinate of each point.
# factory equals factorx if ommited. The default scaling is 1.0.

# *** POLY ***
# :poly point_names...
# defines a polygon that is defined by the given points.
# If no points are given, the range 0-z is assumed.
# Points can either be listed individually, like:
# :poly abc efg x
# or with the range operator '-':
# :poly a-c, e-f, x
# The range operator adds all points in the ASCII-value order.
# Non existing points are simply skipped.
# You can specify a negative range for reverse direction:
# :poly c-a


# *** MAP ***
# :map
# Here, the point coordinates are given. Everything below the :map
# command is considered as part of the point list.

######################## EXAMPLE ################################
:font 7 18 # consolas
:origin 1 2
:scale 7
:poly A-Z
:poly a-d
:map
    z               __P--(Q)-----R # Example map for a C64 Thrust-Style game
A-------B       O---               # 'z' is only used as the player start position
        |       |
        |       |                  # 'A' to 'Z' is the cave polyon.
        |   0   |                  # 0 indicates the origin of coord system
        |       |
        |       |
     ___C       N
    /       b    {M_____       # The { } are cannons
   D       : :          ---L
   |     a.   :...c       K    # 'a' to 'd' form a second polygon -> an island
   |       d...            J
   E}                     I/
    F---------[G]--------H/    # Base of cave


I'm trying to do a C64 Thrust remake. Maybe.
29
Next update raises to 0x10000, that is 65k, K?
30
GLBasic - en / Re: Returning GLBasic user questions :)
« Last post by Widget101 on 2020-Oct-17 »
Hi there,

I've used Anim8or for 3d. It's free and I found it really easy to pick up and use for basic 3d models and 3d levels. Also has its own forum and community.

https://www.anim8or.com/

 :)
Pages: 1 2 [3] 4 5 ... 10