Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

BASIC Forum & Tutorials

The tutorials are useful for self-learning and the forum is good for sharing ideas & information · By david.JamIsFun

BazzBasic version 0.8 released

A topic by Ek Bass created 11 days ago Views: 42 Replies: 2
Viewing posts 1 to 2
(1 edit)

Read at BazzBasic GitHub https://github.com/EkBass/BazzBasic/discussions/10

# BazzBasic version 0.8

Key issues, news and changes from 0.7

## NAudio to SDL2

This change has been done. It was actually easier to do what I expected.  

Audio features works just as with version 0.7

## RAD & DEG

Added keywords **RAD** & **DEG**

## PI & HPI

**PI** returns a hard coded value of *3.141592653589793*  

**HPI** returns a hard coded value of *1.5707963267948966*

These both are commonly and often used when playing with graphics. Hard coding them makes things much faster.

## Fast Trigonometry (Lookup Tables)

For graphics-intensive applications (games, raycasting, animations), BazzBasic provides fast trigonometric functions using pre-calculated lookup tables. These are significantly faster than standard `SIN`/`COS` functions but have 1-degree precision.

**Performance:** ~20x faster than `SIN(RAD(x))` for integer degree values.  

**Memory:** Uses ~5.6 KB when enabled

### FastTrig(<param>)

Enables or disables fast trigonometry lookup tables.

**Parameters:**

- `TRUE` (or any non-zero value) - Creates lookup tables

- `FALSE` (or 0) - Destroys lookup tables and frees memory

### FastSin(angle)

Returns the sine of an angle (in degrees) using a lookup table.

**Parameters:**

- `angle` - Angle in degrees (automatically normalized to 0-359)

**Returns:** Sine value (-1.0 to 1.0)

**Precision:** 1 degree (sufficient for most games and graphics)

```vb

FastTrig(TRUE)

PRINT FastSin(0)    ' Output: 0

PRINT FastSin(90)   ' Output: 1

PRINT FastSin(180)  ' Output: 0

PRINT FastSin(270)  ' Output: -1

' Angles are automatically wrapped

PRINT FastSin(450)  ' Same as FastSin(90) = 1

PRINT FastSin(-90)  ' Same as FastSin(270) = -1

FastTrig(FALSE)

```

### FastCos(angle)

Returns the cosine of an angle (in degrees) using a lookup table.

**Parameters:**

- `angle` - Angle in degrees (automatically normalized to 0-359)

**Returns:** Cosine value (-1.0 to 1.0)

**Precision:** 1 degree (sufficient for most games and graphics)

```vb

FastTrig(TRUE)

PRINT FastCos(0)    ' Output: 1

PRINT FastCos(90)   ' Output: 0

PRINT FastCos(180)  ' Output: -1

PRINT FastCos(270)  ' Output: 0

' Use in raycasting

FOR angle$ = 0 TO 359

    LET dx$ = FastCos(angle$)

    LET dy$ = FastSin(angle$)

    ' Cast ray in direction (dx, dy)

NEXT

FastTrig(FALSE)

```

### FastRad(angle)

Converts degrees to radians using an optimized formula.

**Parameters:**

- `angle` - Angle in degrees (automatically normalized to 0-359)

**Returns:** Angle in radians

**Note:** This function doesn't require `FastTrig(TRUE)` but is included for consistency.

```vb

PRINT FastRad(90)   ' Output: 1.5707963267948966 (HPI)

PRINT FastRad(180)  ' Output: 3.141592653589793 (PI)

PRINT FastRad(360)  ' Output: 6.283185307179586 (2*PI)

```

## Download

Source and Windows binaries https://ekbass.github.io/BazzBasic/

## Version 0.9

For version 0.9, I'm focusing on making sure that the metafiles etc. are in accordance with Windows and Avast reducing warnings when BazzBasic is run for the first time.

The easiest way would probably be to get an account in the Microsoft Store, but it costs money and I don't want to do that since it's a free open source project.

Most of the metafiles are already in order, but GitHub's own "release" method would help even more. However, I haven't had time to learn it yet.

Of course, bug hunting and fine-tuning are definitely expected with version 0.9.

*Kristian Virtanen*  

*krisu.virtanen@gmail.com*  

*https://ekbass.github.io/BazzBasic/*

Version 0.8 has been released? You are so hardworking. Will version 1.0 be released within Feb?

Hi David.

Im not sure, but most likely no. But it will be released way before summer which is the busiest time of year for me.

For 0.9, my plan is to fine-tune the code, add just few functions and fine-tune code even more. After that, ver. 1.0 is just more tested version and I get the console closed if not used. Now its there to show error messages.

For 1.1, I thought add json, yml and xml support (and maybe csv). But lets see how things moves on here.