Search found 44 matches
- Aug 06, 2023 14:10
- Forum: Beginners
- Topic: No such file or directory - New Install
- Replies: 4
- Views: 2458
Re: No such file or directory - New Install
Hi Ivan Just restarted BASIC after many years away and have downloaded the compiler and IDE. Given you restarted recently can you give me some advice as where in windows do I place them. And in what order. Best wishes Keith aka crockhamtown Sorry if this is too late but I've just seen it. I honestl...
- Mar 17, 2022 6:32
- Forum: General
- Topic: -exx closing the program without warning?
- Replies: 4
- Views: 699
Re: -exx closing the program without warning?
... Could someone please help me with this? ... To be able to see the error, you need to compile and execute the program from the command line . Otherwise a console window opens and closes immediately. ... Additionally, why is -exx not put on by default? This seems dangerous! ... Because it adds bo...
- Mar 17, 2022 1:45
- Forum: General
- Topic: -exx closing the program without warning?
- Replies: 4
- Views: 699
-exx closing the program without warning?
G'day, today I was messing about and wrote this piece of code: dim array(10) as integer = {1,6,3,7,2,6,7,9,2,1} for i as integer = -1000 to 9 step 1 print array(i) next i sleep I expected it to immediately crash due to an out of bounds error, and to my shock, it didn't! I learnt about compiler comma...
- Dec 24, 2021 0:50
- Forum: Game Dev
- Topic: Image loading and UDT trouble
- Replies: 13
- Views: 4567
Re: Image loading and UDT trouble
It seems necessary to first dim the variable with the default constructor and then populate it with the secondary constructor, very interesting! Why? You can also do: dim laser as shipWeapon = shipweapon("laz",2,-1,2) Or shorter: var laser = shipweapon("laz",2,-1,2) I was having...
- Dec 19, 2021 2:20
- Forum: Game Dev
- Topic: Image loading and UDT trouble
- Replies: 13
- Views: 4567
Re: Image loading and UDT trouble
I see, thank you very much!paul doe wrote:It's just a convenience function to load a BMP into a Fb.Image buffer, of the proper size. Use it at your leisure.IvanisIvan wrote:...
Paul Doe, what does the second piece of code do? am I supposed to insert it above the previous post?
...
- Dec 19, 2021 2:19
- Forum: Game Dev
- Topic: Image loading and UDT trouble
- Replies: 13
- Views: 4567
Re: Image loading and UDT trouble
right, thank you for teaching me about default constructors! It seems necessary to first dim the variable with the default constructor and then populate it with the secondary constructor, very interesting!dodicat wrote:
- Dec 18, 2021 4:33
- Forum: Game Dev
- Topic: Image loading and UDT trouble
- Replies: 13
- Views: 4567
Re: Image loading and UDT trouble
New question: How should I go about creating a constructor for the shipWeapon type?
- Dec 18, 2021 3:54
- Forum: Game Dev
- Topic: Image loading and UDT trouble
- Replies: 13
- Views: 4567
Re: Image loading and UDT trouble
Thank you both for your implementations! I couldn't work out how to properly dimension those arrays and thank you for teaching me! I also learnt how to cast UDT to strings and other helpful things such as that! The reason I didn't have a graphics mode in there is because it is supposed to be called...
- Dec 17, 2021 6:15
- Forum: Game Dev
- Topic: Image loading and UDT trouble
- Replies: 13
- Views: 4567
Re: Image loading and UDT trouble
btw... I have updated my code down below and attached the error code: D:\My Drive\FreeBASIC Projects\william's game\FBIDETEMP.bas(53) error 24: Invalid data types, before ',' in 'dim occult as ship = "testbg.bmp", 10, 1, {laser, bolter}' type shipWeapon identifier as string damage as inte...
- Dec 17, 2021 3:13
- Forum: Game Dev
- Topic: Image loading and UDT trouble
- Replies: 13
- Views: 4567
Image loading and UDT trouble
G'day! I am very much a beginner in freeBASIC despite coding in it since 2019. My friend's birthday is coming and I thought it would be fun to code him a game. I am re-using the image loading code from about 2 years ago so it is old and may have received it from someone but I do not remember. The is...
- Jul 17, 2021 12:57
- Forum: Beginners
- Topic: Initalising multi-dimentional arrays with muiltiple values
- Replies: 17
- Views: 2185
Re: Initalising multi-dimentional arrays with muiltiple values
The var is a bit like auto in c++ var x=0.0, x is double var y=6, y is integer var s="Hello",s is string. The #define is a macro, I could have made map a function, but the macro behaves like a function (with care), inlined, and it is more compact. Because I have used the division (/) insi...
- Jul 16, 2021 13:26
- Forum: Beginners
- Topic: Initalising multi-dimentional arrays with muiltiple values
- Replies: 17
- Views: 2185
Re: Initalising multi-dimentional arrays with muiltiple values
Because you are ranging a matrix for a screen then I think it better to have 1 to 80 as x co-ordinates and 1 to 45 as y co-ordinates. This saves messing around. Also because you are using a matrix then 1 based is appropriate. Also modularize everything. Sub setupmatrix(maparray() As Long) Var lb1=L...
- Jul 16, 2021 13:07
- Forum: Beginners
- Topic: Initalising multi-dimentional arrays with muiltiple values
- Replies: 17
- Views: 2185
Re: Initalising multi-dimentional arrays with muiltiple values
Because you are ranging a matrix for a screen then I think it better to have 1 to 80 as x co-ordinates and 1 to 45 as y co-ordinates. This saves messing around. Also because you are using a matrix then 1 based is appropriate. Also modularize everything. Sub setupmatrix(maparray() As Long) Var lb1=L...
- Jul 16, 2021 6:25
- Forum: Beginners
- Topic: Initalising multi-dimentional arrays with muiltiple values
- Replies: 17
- Views: 2185
Re: Initalising multi-dimentional arrays with muiltiple values
In all the graphics keywords, (x, y) designates the point of abscissa x (horizontal deviation) and of ordinate y (vertical deviation), with respect to the first point at the top left (0, 0) . The most logical thing for you would be to define an array rather like: dim mapArray (79,44) Example: #incl...
- Jul 16, 2021 4:03
- Forum: Beginners
- Topic: Initalising multi-dimentional arrays with muiltiple values
- Replies: 17
- Views: 2185
Re: Initalising multi-dimentional arrays with muiltiple values
I now struggle drawing the array to the screen!!! I wanted to draw the array as 16 by 16 pixel red boxes, creating vertical lines along the edge of the screen, however, it seems to rotate itself 90 degrees. I also haven't sorted out the spacing yet...I have left the code block in question below! #in...