Posts: 11
Threads: 3
Joined: Dec 2022
Reputation:
0
Thought I'd say hello, since that's what I'm told I should do in the T.R. game programming tutorial. This will maybe be my fourth attempt at learning to program. Hopefully this time I'll make a breakthrough. Any suggestions as to how I should proceed to learn are appreciated. What brings me here again is that I got a game on Steam called Retro Gadget. The game involves using Lua to program certain gadgets you create. It reminded me of how much I disliked Python, and Lua seems very similar. It got me thinking about how I seemed to enjoy learning with QB64 as it seems to sort of explain how things work "under the hood". So I figured why not give it another shot. With a bit more knowledge, I can create the gadgets in that game and actually feel like I built them myself.
Posts: 1,586
Threads: 59
Joined: Jul 2022
Reputation:
52
Welcome to the forums.
Lua could be less like Python, except for the pressure to "OOP". You need to get your priorities in order. Learning BASIC isn't going to increase your aptitude about Lua, and the other way around. QB64(PE) is a totally different world from what you might have seen and it's going to lead to more frustration if you don't take the time to learn, if you don't accept the important differences between QB64 programming system and an interpreter's programming system helped by a large number of libraries.
The two worlds aren't compatible. If you want to program a game with QB64(PE) you have to throw away what you have done with a different programming language, which doesn't belong in a beginner's tutorial such as class definitions and module dependencies. It's because QB64(PE) aims to be compatible with a commercial product sold in the late 1980's which then unfolded into an interpreter packaged with a different commercial product, for an operating system way more limited than Windows, Macintosh, Linux and even Free/Open/NetBSD.
One thing I must warn you about is that QB64(PE) does not support functions created by the program, which supports an unknown number of parameters. A function may not have the same name as another declared function nor a reserved word (cannot overload a function nor operator). It does not support more than one variable to assign on LHS, like Lua and Python could. QB64(PE) could support OOP in the future, in the style of Freebasic. For the moment, you may not declare functions and arrays inside an user-defined type (UDT, which is like "struct" in C, less like "class" in C++). If you need an array badly inside an UDT, you have to declare a _MEM variable and take the trouble yourself allocating its extent and getting and setting the data. The string handling in QB64(PE) is as good, if not better than that of Lua and Python. This is most important to cover up ommissions like the inability to overload a function with the number of parameters to pass it. Arrays in QB64(PE) are as limited as they are in C/C++, not like the complex and slow structures but which are convenient in the interpreted languages. One programming in Python doesn't even have to think about writing a hash table library -- it is "built in". With QB64(PE) there are implementations by different people, including one which is part of the source code of the programming system.
The way to do graphics, input method, music, threads and other things is different from Python strung with third-party libraries. That's why many programmers have given up doing ports, trying to choose what is most similar and changing the least amount of code lines and source files possible.
I don't know what you're trying to do with the game you're building. It might be possible in QB64(PE) to build a program that creates sliders and text fields and stuff like that, for user input. The problem is that the main way to communicate with other programs is with "SHELL" statement which is inefficient and contains a slight security risk. If you're unwilling to do the whole game in QB64(PE) then I suggest you continue studying into one of those interpreted languages, so you could finish your project. There is a way to interface between QB64(PE) and the third-party libraries but very few coders have attempted it, and the function prototypes have to be known (ie. name of function, what are the parameters, what is the return value, what is the expected duty of that function and more).
Posts: 176
Threads: 13
Joined: Apr 2022
Reputation:
5
"fistfullofnails"
First. Welcome to the forums.
There are many books and tutorial for learning Lua and Python, but as for QB64pe, I would suggest Terry's Tutorials... https://www.qb64tutorial.com/the-tutorial
Starts with the basics (Sorry. No pun intended) and then works it way through most of its functions.
But, if you are like me and need a LOT of help, we have a great collection of programmers that are on this forum for 'that' specific purpose....
Enjoy your stay with us. Remember. If you are not having fun then you are doing it wrong... lol
J
May your journey be free of incident. Live long and prosper.
Posts: 383
Threads: 56
Joined: Apr 2022
Reputation:
13
That's an interesting handle "fistfullofnails", is there a story behind it? Perhaps a Christmas reference to a historic carpenter? Anyway, as johnno56 says, lots of wonderful programmers here that are extremely helpful for those of us that have that bald spot from scratching our head in ponderment.
Posts: 1,272
Threads: 119
Joined: Apr 2022
Reputation:
100
Welcome!
I'm glad my tutorial brought you to us. Please feel free to ask questions here at the forum (there are no dumb questions by the way) or directly to me through the email address provided on the tutorial site.
I also like QB64 because of how you need to use it ... that is most everything needs to be made from scratch which in my opinion makes a better programmer and well it's just more satisfying to roll you own so to speak.
Again, Welcome!
Posts: 11
Threads: 3
Joined: Dec 2022
Reputation:
0
(12-26-2022, 12:35 AM)mnrvovrfc Wrote: Welcome to the forums.
Thanks for all of the heads ups. I do not really have a game I'm wanting to create. I just find that I like to just piddle around basically. I generally like to make attempts at modeling things now. My last stint into QB64 was creating a fan graphic that would turn on and off according to pressing a power button, with adjustable speed settings.
Posts: 11
Threads: 3
Joined: Dec 2022
Reputation:
0
(12-26-2022, 05:02 AM)johnno56 Wrote: "fistfullofnails"
First. Welcome to the forums.
There are many books and tutorial for learning Lua and Python, but as for QB64pe, I would suggest Terry's Tutorials... https://www.qb64tutorial.com/the-tutorial
Starts with the basics (Sorry. No pun intended) and then works it way through most of its functions.
But, if you are like me and need a LOT of help, we have a great collection of programmers that are on this forum for 'that' specific purpose....
Enjoy your stay with us. Remember. If you are not having fun then you are doing it wrong... lol
J
I already have plenty of Python books. Thanks, and I'll definitely being tapping into the brains here at some point.
Posts: 11
Threads: 3
Joined: Dec 2022
Reputation:
0
(12-26-2022, 04:03 PM)Dimster Wrote: That's an interesting handle "fistfullofnails", is there a story behind it? Perhaps a Christmas reference to a historic carpenter? Anyway, as johnno56 says, lots of wonderful programmers here that are extremely helpful for those of us that have that bald spot from scratching our head in ponderment.
You are pretty close on your guess about my handle. I was a carpenter for awhile.
Posts: 11
Threads: 3
Joined: Dec 2022
Reputation:
0
12-28-2022, 11:35 PM
(This post was last modified: 12-29-2022, 06:28 AM by fistfullofnails.
Edit Reason: New thoughts
)
(12-26-2022, 11:13 PM)TerryRitchie Wrote: Welcome!
I'm glad my tutorial brought you to us. Please feel free to ask questions here at the forum (there are no dumb questions by the way) or directly to me through the email address provided on the tutorial site.
I also like QB64 because of how you need to use it ... that is most everything needs to be made from scratch which in my opinion makes a better programmer and well it's just more satisfying to roll you own so to speak.
Again, Welcome!
You nailed it on the head when you said everything needs to be made from scratch. That's what seems to be what is curing my itch haha. I really appreciate you making that tutorial. I keep coming back to it as opposed to the thousands of beginner tutorials out there in all the various languages. I read an article somewhere where a programmer was speculating that growing up in the 80's and having the limited number of languages, software, simpler computers, etc. was a huge advantage compared to trying to learn about those things now. I wish I could have an old computer from back then and one of the hefty manuals that came with them.
Here's an example of why I don't like Lua, Python, etc. The game I was playing on steam I mentioned has you "program" a light to turn on. The answer to it was something like gdt.Led0.ButtonState.true. I don't feel too proud of myself when achieving this feat, as it was someone else that did the actual programming and I just absentmindedly plugged it in. Also while thinking to myself, "What the $#!@ is this actually doing?" Using what I've learned from your tutorials for the most part, I have achieved pretty much the same thing with QB64, feel proud about it, and at least have a clue on what the code is actually doing. Thanks for your tutorial, and please make some more.
Edit: Lol, last night I was trying to figure out how to draw a spiral on my own using a loop. I just now realized while doing the Illusion.BAS program of your tutorial, that it's essentially a drawing of a spiral. I have a question about the program though. I notice on Illusion2.BAS, that you do not assign a value to the x1% or y1% integer variables. Does this result in those variables being automatically assigned a value of zero by the computer itself?
Posts: 276
Threads: 14
Joined: Apr 2022
Reputation:
27
Welcome!
I agree with Terry too. Any time I've ever tried to wrap my head around another language, I've generally found that the same concepts are in play and only the dialect of syntax varies. That some languages include a slew of libraries is all very convenient, as long as you are familiar with them, but then you're just stringing together someone else's code IMO. You hope they did it right.
That will certainly get you to a goal, unless the goal is to become the guy that wrote the library. I'm no professional programmer and QB64 is the toolbox that has more than I can use, and in a language that I'm already familiar with.
It's very similar to my fascination with the bootstrapping of the industrial revolution by a bunch of guys with some ideas, hand tools and patience. There's nothing quite like coming upon a coding problem; and with a "basic" toolset, creating something that works from scratch.
DO: LOOP: DO: LOOP
sha_na_na_na_na_na_na_na_na_na:
|