Search found 1390 matches

by badidea
Oct 20, 2010 14:50
Forum: Beginners
Topic: Giving up..pulling my hair out
Replies: 15
Views: 1292

I guess 90% of people who try Bload or PNG_Load make this mistake, including myself. Very, very big, bold, huge, impossible to overlook warning in the help files would be nice. However, spending 9 hours on it must be a record.
by badidea
Oct 18, 2010 22:44
Forum: Tips and Tricks
Topic: h4tt3n's spring physics simulation tutorial
Replies: 18
Views: 14065

Nice piece of documentation. Using this, I made some code showing "vector on vector projection" and "projection on normal vector". This kind of code can typically be used for (e.g.) a sailing boat simulator. Where wind direction, boat direction and sail angle are variables. And where the forward pus...
by badidea
Oct 13, 2010 16:26
Forum: Tips and Tricks
Topic: Decimal places limit / limiter
Replies: 7
Views: 886

I made something similar, but yours is more compact. function formatSglStr(value as single, decimals as integer) as string dim as string text = str(value) dim as integer decSepPos = instr(text, ".") if (decSepPos) then if (decimals) then text = mid&#...
by badidea
Oct 06, 2010 22:48
Forum: General
Topic: Translating C to Freebasic
Replies: 11
Views: 964

Maybe i stupid question, but what is the difference between and and andAlso? First time I see the andAlso the statement.
by badidea
Sep 25, 2010 0:08
Forum: Beginners
Topic: I'm a little lost :(
Replies: 19
Views: 2263

I have an idea for you which should be doable: Four-in-a-row
First a user input only, if that works, try to add a computer opponent.
Well, maybe better to start with: Tic-tac-toe
by badidea
Sep 24, 2010 23:52
Forum: Beginners
Topic: I'm a little lost :(
Replies: 19
Views: 2263

Oh, and if you get stuck with some concrete piece of code, ask people for advice. Try to describe want you what it to do as clear as possible. Show the piece of code you have come up with so far. E.g. If you want to move around a circle (or an image) on the screen based on keyboard input, but you do...
by badidea
Sep 24, 2010 23:33
Forum: Beginners
Topic: I'm a little lost :(
Replies: 19
Views: 2263

I say, start with simple things. Don't think you program a World of Warcraft competitor after 1.5 moths of experience. Before you start FBIDE, try to come up with an idea you like, and is not to complicated. If you like games, try to make tetris or pacman like games. If you like physics, try a space...
by badidea
Sep 24, 2010 20:45
Forum: Game Dev
Topic: Print bitmat font text
Replies: 1
Views: 1808

I made some improvements. Removed the xSpacing for a more gentle solution to get characters closer together. #include "file.bi" #include "fbgfx.bi" Type bitmap_header Field = 1 bfType As UShort bfsize As UInteger bfReserved1 As UShort bfReserved2 As UShort bfOffBits As UInteger b...
by badidea
Sep 19, 2010 0:39
Forum: Game Dev
Topic: Print bitmat font text
Replies: 1
Views: 1808

Print bitmat font text

OK, this has probably been done a million times. I might even have done this myself before, but since programming something is more fun than searching for code, I made this: #include "file.bi" Type bitmap_header Field = 1 bfType As UShort bfsize As UInteger bfReserved1 As UShort bfReserved...
by badidea
Sep 18, 2010 23:40
Forum: Projects
Topic: Games: Artillery Wars - with net play... and Lemmings clone.
Replies: 11
Views: 4348

Well, both look nice. Bit hard to read the code, since my polish (is it polish?) isn't very good. How much time did you spend on the games so far?
by badidea
Sep 15, 2010 0:03
Forum: Tips and Tricks
Topic: Lazy Man's Test for Non-Integer Values (Never Mind)
Replies: 23
Views: 2597

Above a certain value, the accuracy exceeds 1. See:

Code: Select all

dim as integer i
dim as single float = &hfffffa

for i = 1 to 20
  print float, hex(float)
  float +=1
next
sleep
by badidea
Sep 14, 2010 23:34
Forum: Tips and Tricks
Topic: Lazy Man's Test for Non-Integer Values (Never Mind)
Replies: 23
Views: 2597

Yes, perfect: Function isInt( Byval n As Single ) As Integer Return (Not isFloat(n)) End Function Function isFloat( Byval n As Single ) As Integer Return (Not isInt(n)) End Function I think, the only think you can do is test if the float is close to an...
by badidea
Sep 11, 2010 13:09
Forum: General
Topic: Print name of an object?
Replies: 9
Views: 814

Ok, going to use destructors.
by badidea
Sep 11, 2010 1:20
Forum: General
Topic: Print name of an object?
Replies: 9
Views: 814

Ah, that is not good. I am producing more bugs then sensible code at the moment. Maybe it is better to continue tomorrow.
by badidea
Sep 10, 2010 23:54
Forum: General
Topic: Print name of an object?
Replies: 9
Views: 814

Actually, it may not be so important, since i just decided to make one array of sprites. And just do this: for i = 0 to MAX_SPRITES-1 if (sprite(i).pImage = NULL) then sprite(i).destroy() next This way I cannot forget to destroy (deallocate) an image. Or maybe better ...

Go to advanced search