Search found 1452 matches

by badidea
Sep 21, 2019 10:17
Forum: General
Topic: First try at extended classes
Replies: 15
Views: 401

Re: First try at extended classes

It does not looks so nice. I tried with a separate subroutine, but that goes wrong: type astro_object dim as single x, y 'position dim as single mass, radius declare constructor() end type constructor astro_object() x = 1 : y = 2 : mass = 3 : radius = 4 end constructor type planet_type extends astro...
by badidea
Sep 20, 2019 23:27
Forum: General
Topic: First try at extended classes
Replies: 15
Views: 401

Re: First try at extended classes

I have another extended class question. Lets say I have a base class astro_object and 2 extended classes planet_type end comet_type (each with there own added properties and methods). Next I have 2 classes containing a list planets and a list of comets: planet_list_type and comet_list_type . All nic...
by badidea
Sep 18, 2019 7:09
Forum: Hardware Interfaces / Communication
Topic: TP-Link HS110
Replies: 5
Views: 188

Re: TP-Link HS110

> & I speficy byte order and byte alignment. https://docs.python.org/2/library/struct.html edit: not "l" but "I" Also not exactly sure what python is doing, but my best guess for this freebasic version of encrypt / decrypt is this: function encrypt(byref cmd as string) as str...
by badidea
Sep 17, 2019 21:24
Forum: Hardware Interfaces / Communication
Topic: TP-Link HS110
Replies: 5
Views: 188

Re: TP-Link HS110

Not sure if such an easy to hack device is wise to use in a museum, but it looks like a fun project. The socket part should be possible in freeBASIC, but will take some time to get familiar with. There are some network libraries on this forum that might work, but you can also implement the socket AP...
by badidea
Sep 16, 2019 17:42
Forum: Projects
Topic: Full RGB image to DOS CGA and EGA
Replies: 9
Views: 271

Re: Full RGB image to DOS CGA and EGA

caseih wrote:The 8-Bit Guy recently released a game that has pretty good graphics for CGA as seen in the screenshot below.

I prefer the the 256-color mode:
Image
by badidea
Sep 15, 2019 22:17
Forum: Projects
Topic: Full RGB image to DOS CGA and EGA
Replies: 9
Views: 271

Re: Full RGB image to DOS CGA and EGA

All nice, but CGA and EGA, that is a quite long ago. 25 years?

Anyway, I thought that freebasic automatically converts "/" to "\" (and the other way around?) for file usage depending on the OS.
by badidea
Sep 14, 2019 19:11
Forum: Windows
Topic: Setting gcc compiler for WinFBE
Replies: 93
Views: 2826

Re: Setting gcc compiler for WinFBE

Sorry, Microsoft not that anyone there is reading this. Don't worry, if Microsoft invalidates your licence key, you can always switch to GNU/linux. Don't have any experience with DPI-awareness on linux yet. Switched it off because I don't have a really high-DPI screen and standard font size (e.g. i...
by badidea
Sep 14, 2019 12:17
Forum: General
Topic: String to number conversion with error handling
Replies: 4
Views: 148

Re: String to number conversion with error handling

Maybe this topic can help: IsValue vs IsNumeric If only unsigned integer values are of interest, then a custom check is quickly written, e.g.: 'for single-byte encoded strings an unsigned integer values only function checkNumber(numberStr as string) as integer for i as integer = 0 to len(numberStr) ...
by badidea
Sep 14, 2019 10:59
Forum: Linux
Topic: Installing on Linux Mint 19
Replies: 8
Views: 205

Re: Installing on Linux Mint 19

There are some hints in the readme.txt that comes with freebasic: ... o Installation & Usage ... Linux (if FreeBASIC is not available through your package manager): Download and extract the latest FreeBASIC-x.xx.x-linux.tar.gz. Open a terminal and cd into the extracted FreeBASIC-x.xx.x-linux dir...
by badidea
Sep 12, 2019 22:08
Forum: General
Topic: First try at extended classes
Replies: 15
Views: 401

Re: First try at extended classes

Thanks both, enough clarification for now.
I forgot about &, much cleaner then + str(...) indeed.
by badidea
Sep 11, 2019 22:45
Forum: General
Topic: First try at extended classes
Replies: 15
Views: 401

First try at extended classes

I found a reason to have look at extended classes. Although, not for the example code below, but for something similar. It is not as complicated as it thought is was. But 2 questions for the example code below: 1. I initially used base.constructor(...) instead of base(...) in the extended class. But...
by badidea
Sep 09, 2019 22:35
Forum: Game Dev
Topic: Physics question
Replies: 74
Views: 6498

Re: Physics question

Small update: * One can shoot at a asteroid to remove it, costs 10% fuel * Helium-3 atom clouds with rotating core animation * Additional control of side thrusters <A>, <D> (does not make control easier) #Include "fbgfx.bi" Type int2d As Integer x, y Declare Constructor Declare Constructor...
by badidea
Sep 09, 2019 20:24
Forum: General
Topic: Squares
Replies: 6887
Views: 405126

Re: Squares

Random square doodle, not worth its own topic: const SW = 800, SH = 600 Const As Single PI = 4 * Atn(1) Const As Single RAD_PER_DEG = (PI / 180) Const As Single DEG_PER_RAD = 180 / PI '------------------------------------------------------------------------------- type int2d dim as integer x, y Decl...
by badidea
Sep 09, 2019 17:05
Forum: Projects
Topic: FBStyle - Source code formatter
Replies: 3
Views: 2208

Re: FBStyle - Source code formatter

Alternative: FBeauty
by badidea
Sep 08, 2019 22:42
Forum: General
Topic: Help with direct mouse input
Replies: 3
Views: 175

Re: Help with direct mouse input

This works here with SDL2 (relative motion, no window or screen borders): 'https://wiki.libsdl.org/CategoryMouse 'http://gigi.nullneuron.net/gigilabs/handling-keyboard-and-mouse-events-in-sdl2/ #include "SDL2/SDL.bi" dim sdlversion as SDL_version SDL_GetVersion(@sdlversion) print "SDL...

Go to advanced search