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

#121
I'm interested in your race track as I am trying something similar. Any chance of video demo?

Sh sh sh shadows  :sick:. It's tricky but the 3D samples folder that demonstrates it. As object need to be drawn twice, it's cuts the processing time in half.

Normal spotlight
Draw objects
Turn on shadow spot light
Draw objects (again same)
Cast shadow spot light color

For each of a maximum of seven spotlights (num 0 - 7) there is a shadow light and repeated objects drawn (doubled), then another shadow spotlight. :doubt:

Here's my shadow room low and hires tests:
https://www.youtube.com/watch?v=5k2FRHlL5tI
8)

From 3D Samples folder:
..\Samples\3D\Shadows\Shadows.gbas
Code (glbasic) Select

// --------------------------------- //
// Project: Shadows
// Start: Thursday, January 19, 2006
// IDE Version: 3.011


// konstante Werte / Constant values
LOCAL image, none, shadow, sphere, donut, cube, spot_ang, lmode, phi, lx
LOCAL ly, lz, i, psi, px, py, pz, j

none = -1
image = 0

donut  = 0
cube   = 1
sphere = 2
// Create Primitives
CreateTorus (donut, 10, 20, 36, 12, 2, 2, RGB(255,255,255))
CreateCube  (cube, -1000, RGB(255, 255, 255))

// Grafiken laden / load graphics
LOADSPRITE      "image.bmp", image
//LOADBUMPTEXTURE "bump.bmp",  bump
LOCAL mx, my, b1, b2 // compiler warning

WHILE TRUE
// naja... / well...
mx = mx + MOUSEAXIS(0)
// MOUSESTATE mx, my, b1, b2

// 1000 ist weit genug hier / 1000 is far enough here
X_MAKE3D 1, 1700, 45

// ein Winkel für alles / one angle for everything
phi = GETTIMERALL() / 250

// eine Lichtposition / a light position
lx = SIN(-phi*3)*300
ly = 20 //(SIN(3*phi)-COS(4*phi))*100
lz = COS(-phi*3)*300

// Maus X=drehen / Mouse X=turn
X_CAMERA 400*COS(mx),120,400*SIN(mx), 0,0,0

// Licht als Punkt zeichnen / Draw light as dot
X_DOT lx,ly,lz,32,RGB(255,255,255)

// Texture setzen / Set texture
X_SETTEXTURE image, none

X_CULLMODE 1

X_SPOT_LT   0, RGB(255,255,255), lx,ly,lz, -lx,-ly,-lz, 360

// Würfel zeichnen / Draw Cube
X_DRAWOBJ cube, 0

// Donut zeichnen / Draw Donut
X_MOVEMENT 0,0,0
X_ROTATION 45, 1,0,0
X_DRAWOBJ donut,0

// Schatten einschalten / turn on Shadows
X_SPOT_LT  -3, 0, lx,ly,lz, -lx,-ly,-lz, 360

// neuzechnen von schatten-werfenden Objekten
// re-draw shadow casting objects
X_MOVEMENT 0,0,0
X_ROTATION 45, 1,0,0
X_DRAWOBJ donut,0

// Schatten zeichnen / draw shadows
X_SPOT_LT  -3, RGB(0,0,64), 0,0,0, 0,0,0, 0
// oder / or
// X_MAKE2D, SHOWSCREEN, X_MAKE3D


// zum Zurechtfinden / for navigation
X_DRAWAXES 0,0,0
X_MAKE2D
PRINT my, 0,0
SHOWSCREEN
WEND


#122
As erico kindly mentioned, it's very useful to create utilities to just produce code for classic 80s BASIC. There was a cool BBC interpreter and maybe some Turtle Logo I've seen on the board. The idea of cutting old code, parsing it and having it run sounds real cool, even if you covert/translate/invent your own terms.

Anyhow, I'm going to try an answer the question in the most practical way if precise commands aren't required. To replace DRAWRECT and reduce the parameter parsing efficiency, I use my own type class

Code (glbasic) Select

rect.draw()


Here is an example.

Code (glbasic) Select


TYPE _rect
x
y
width
height
color
texture
FUNCTION draw:
IF self.texture <> -1
STRETCHSPRITE self.texture, self.x, self.y, self.width, self.height
ELSE
DRAWRECT self.x, self.y, self.width, self.height, self.color
ENDIF
ENDFUNCTION
ENDTYPE

TYPE _scene
rect AS _rect
FUNCTION begin:
self.rect.x = 10
self.rect.y = 20
self.rect.width = 30
self.rect.height = 40
self.rect.color = 0xff0000
self.rect.texture = -1
WHILE TRUE
CLEARSCREEN
self.rect.y = 20
INC self.rect.y, SIN(GETTIMERALL()) * 10
self.rect.draw()
SHOWSCREEN
WEND
ENDFUNCTION
ENDTYPE

GLOBAL scene AS _scene
scene.begin()

#123
We really need to design and build an simple adventure engine for now. If you have a bit of artwork than I can use to test with, then we can start there I suppose.
#124
Yeah I know about Jim's for a long while now and it's where I get some tips from.

erico, let's get back next year and start on this game!  :D :D :D :D :D :D :D :D
#125
I can load the font fine by placing it in the Media subfolder and then LOADFONT "Media/font.png" and not using SETCURRENTDIR$().
#126
8) It would be nice to build an arcade cabinet or a table.  :good: Now I have been testing GLBasic on the RPI2 recently and also with simple Arduino input and output via a shell gpio command. This is cool for hardware buttons, controls and displays, and also fine for a entertainment unit or kiosk.  :P

There are issues though with only able to use LOADFONT, PRINT and DRAWSRITE.  :help: Music is fine and but some 2D polys or even 3D would be good.  :sick:
#127
Great news. :enc: For now, there are compile errors for old complex project but works fine otherwise. Interesting to see a change for the platform selection. v8, 10, 12 & 14 SDKs are now installed on my system, which I need for older devices and projects.
#128
Cheesecake anyone?  :whistle:

Quote from: mentalthink on 2015-Aug-04
...about Html5 and seems don't will be the stantard for browsers...

Quote from: spacefractal on 2015-Aug-10
Except Unity require a plugin.... More more browsers have begin to remove this kind of supports.

Back to square one then. I think this is the reality and this is more of a general technical platform standard, rather than SDK support.  :zzz:
#129
+1 for what erico said (posted really)  ;)
#130
Quote from: GarBenjamin on 2015-Aug-10
Is the HTML5 stuff being worked on?

Oh yeah, the large GLBasic team should have the next version out later this week.  :O :D
#131
The importance of HTML5 for web games is high at the moment because there's just an abundance of indie titles being produced all the time. So if you are targeting the one click game play market, now is a good time. For example: http://itch.io/
#132
The fresh OP asks a strange question. I have created utilities to produce Coco Basic code but not machine code.
#133
Media Section / Re: Chiptone
2015-Aug-02
That only saves binary data for the configuration data file and a wav audio export. What is need is the data for the sound wave.  :(

Code (glbasic) Select

ins$[0] = "3,0.000,0.080,0.950,0.400,0.330,0.000,-0.140,-0.070,0.000,0.000,-0.520,0.000,0.000,0.000,0.030,1.000,0.420,1.000,1.000,0.000,0.000,0.000" // snare
ins$[1] = "2,0.030,0.110,0.080,0.000,0.330,0.000,-0.440,-0.250,0.000,0.000,0.000,0.000,0.000,-0.010,0.000,-0.010,-0.010,1.000,0.000,0.000,0.340,0.000" // bass drum
ins$[2] = "3,0.000,0.050,0.000,0.170,1.000,0.920,-0.070,-0.070,0.000,0.000,0.030,0.000,0.000,0.000,0.030,1.000,0.420,1.000,1.000,0.000,0.000,0.000" // hihat
sfx$ = SFX_DDgui$(ins$[0])
SFXR(sfx$, filename$)


Overall, it's the efficiency of having to create the media at first install run-time on various devices, like with multi-texture re-rendered resolutions and other media, rather than having to ship all pre-made. It also means that new and improved media can be created by simple command, so there's no artist tech support.  :P
#134
Media Section / Re: Chiptone
2015-Aug-02
In the case of standalone executable Helmos, sprites and wavs are initially produced runtime, so I prefer the sound data. That is point of using sfxr library in conjunction with other sfxr utilities.  ;)
#135
 :coke: Great and, naturally, will test later.