Pages: « 1 2
  Print  
Author Topic: How to do conditional branching in C++ ?  (Read 2799 times)
Offline (Unknown gender) Darkstar2
Reply #15 Posted on: April 29, 2014, 11:04:43 PM
Member
Joined: Jan 2014
Posts: 1244

View Profile Email
Can you create GUI apps in QT using C++ ?

Also about all those includes / headers you have to include
at the beginning, how do you know which ones to use?
How can one memorize it all ?  How do I determine the headers to use based on what I want to do?

Logged
Offline (Male) Goombert
Reply #16 Posted on: April 29, 2014, 11:09:52 PM

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 3110

View Profile
Yes Qt is a generic framework for software like .NET except more fully featured and more lightweight because it is C++, it is often used to make games as well.

And you just pretty much have to memorize the headers, sometimes I Google when I forget some, but usually that is why documentation is provided for API's to tell you what headers to use. And Qt is well known for its great documentation, C# and Java are the same except Eclipse IDE will tell you where to import from and automatically import the packages for you, kind of like if C++ had a thing that would auto write your include statements for you.

Why don't you start off trying to build LateralGM? It's a pretty big application but it is easy to build.
« Last Edit: April 29, 2014, 11:11:56 PM by Robert B Colton » Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Offline (Unknown gender) Darkstar2
Reply #17 Posted on: April 29, 2014, 11:22:36 PM
Member
Joined: Jan 2014
Posts: 1244

View Profile Email
LMAO you are kidding me right ?

That's probably the funniest thing I read today :P

Yeah I can barely build shit with C++ yet, but thanks for your confidence  ;D


Logged
Offline (Male) Goombert
Reply #18 Posted on: April 29, 2014, 11:26:34 PM

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 3110

View Profile
No I am being serious, I meant for you to do it as a stepping stone, it is extremely easy to build, you just have to download LGM's source and download eclipse, then import LGM, and build it.

1) Download LGM's source code. Visit the GitHub link and select "Download ZIP"
https://github.com/IsmAvatar/LateralGM

2) Download Eclipse stand alone, the current stable which is what I use.
https://www.eclipse.org/downloads/

3) Extract LGM's source code and Eclipse from their respective ZIP archives, then launch eclipse.

4) File->Import, and select "Existing Projects into Workspace", find LGM and import her.

5) When it finishes importing, click the green run button, when it asks what you run as select "Run as Application"

And there you go, you now know how to build LGM, so go on, try it!  (Y)
Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Offline (Unknown gender) Darkstar2
Reply #19 Posted on: April 29, 2014, 11:34:43 PM
Member
Joined: Jan 2014
Posts: 1244

View Profile Email
I thought you said LGM was done in JAVA, I know nothing of JAVA and I don't want to either, i'm in over my head, I barely know enough GML to make advanced stuff.   I still have lots to do here before getting to that but will definitely keep this in mind just out of curiosity now that you have me curious :D  First I would like to learn B2D since physics is still broken and not included in the IDE.  BTW did you get a chance to check my file (EGM) ?

Hopefully I could eventually do some creative stuff I could
add to LGM........  :P
Logged
Offline (Male) Goombert
Reply #20 Posted on: April 29, 2014, 11:43:15 PM

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 3110

View Profile
I don't have any need to check that file because you said instance create was working fine, as long as instance create is not broken IDC. But I did just fix the compiling errors so the Studio functions will build but they aren't finished. Anyway, that file has no use to me because I already know what needs done to add full compatibility for Studio physics.

Anyway, if you would give Java a try you would see it is exceptionally easier than using GML, Eclipse has beautiful automatic completion, and you can read documentation as you type functions, it is way easier than digging through pages to find functions like you do in GML, plus you can Google and find a million results for Java programming, where as GML is not you know a widely used programming language. Java is also amazing with eclipse because you can click in the error log and be taken right to the exact line that caused the error and get a full stack trace showing the whole chain of events. Similar arguments apply to C# as well, but C# is not as good at this stuff, this is why people rave about Eclipse as an IDE. Anyway, this is exactly why C# and Java are popular to newbies, if you would give them a try you'd see they are much easier to learn than GML, and you'll learn proper programming and that knowledge can then be applied to learning C++.
Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Offline (Unknown gender) Darkstar2
Reply #21 Posted on: April 30, 2014, 12:09:12 AM
Member
Joined: Jan 2014
Posts: 1244

View Profile Email
I don't have any need to check that file because you said instance create was working fine, as long as instance create is not broken IDC. But I did just fix the compiling errors so the Studio functions will build but they aren't

You said you fixed B2D physics with that fix, which it was not fixed ,that's the initial reason I sent the EGM, the instnace thing was just a small detail.  I don't care about the studio physics extension, but you said B2D was functional and asked how do I apply B2D with the project I did in that EGM, because nothing moves.....Do I have to
do it all manually with the B2D commands, will it work, if so I will just make a script to make it easier but need to make sure B2D physics does work as to not do this for nothing, you did mention B2D was fixed. :)  I could care less about Studio compatibility for now if B2D can do more.

Quote
Anyway, if you would give Java a try you would see it is exceptionally easier than using GML, Eclipse has beautiful automatic completion, and you can read documentation as you type functions, it is way easier than digging through pages to find functions like you do in GML, plus you can Google and find a million results for Java programming, where as GML is not you know a widely used programming language. Java is also amazing with eclipse because you can click in the error log and be taken right to the exact line that caused the error and get a full stack trace showing the whole chain of events. Similar arguments apply to C# as well, but C# is not as good at this stuff, this is why people rave about Eclipse as an IDE. Anyway, this is exactly why C# and Java are popular to newbies, if you would give them a try you'd see they are much easier to learn than GML, and you'll learn proper programming and that knowledge can then be applied to learning C++.

One step at a time. 

Stuff I want to eventually get into:

* Learning more GML / advanced
* Learn how to do things manually such as B2D
* Experimenting with ENIGMA more and building stuff
* Getting to know more about C++
* Going through LGM, and other sources to see how things are done.

I did not do BASIC and ASM overnight :D

Logged
Offline (Male) Goombert
Reply #22 Posted on: April 30, 2014, 12:16:53 AM

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 3110

View Profile
You to do it all through code, literally all the functions are documented on the Wiki.
http://enigma-dev.org/docs/Wiki/Box2D_Functions

I just built my example game and it worked fine.
https://www.dropbox.com/s/11svwsiwvd31yim/enigmaphysicstest.egm
Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Offline (Unknown gender) Darkstar2
Reply #23 Posted on: April 30, 2014, 04:38:30 PM
Member
Joined: Jan 2014
Posts: 1244

View Profile Email
You to do it all through code, literally all the functions are documented on the Wiki.
http://enigma-dev.org/docs/Wiki/Box2D_Functions

I just built my example game and it worked fine.
https://www.dropbox.com/s/11svwsiwvd31yim/enigmaphysicstest.egm

Not all are documented :P  b2d world update settings are not listed anywhere, only the b2d world update.
Also certain things are not documented right,
and they document each individual commands but don't give an example of what is required step by step COMBINED, so for a new person it is very confusing.  I looked at your example, you also made
some mistakes in the coding, I wonder if at the time you made this there were issues with ENIGMA where you had to compensate by tweaking things.

For example, why did you set room speed to 1000 ?
This causes the smiley square player to go way too fast, so much that it disappears :P  I fixed that by setting room speed down to 30, it did not affect other objects.

Also very confused about the fps/1 and fps/30 and world update settings, that was not documented.
b2d_world_update_settings(global.world, timestep, 8, 3);
b2d_world_update(global.world);

So it should be this:
b2d_world_update_settings(index, timeStep,velocityIterations, positionIterations)

I think you figured out where I found this out ! lol!

Also b2d world update is documented as
b2d_world_update()
shouldn't it be b2d_world_update(id) ?

Your project is quite different than what I want to do so I just removed stuff and isolated stuff and will attempt to see if I can adapt this to what I want to do, but think I have the general idea.

If for example I have a sprite of a ball,
I have to create a body, apply a shape in this case
circle and its radius, then apply a fixture and
set my world (equivalent to the room physics in IDE)
am I correct ?  and apply the world update thingy
in step.  You have to understand that coming from GMStupido I have to relearn because in GMS all that is handled for you :P all you do is set the object shape type and points and add null collisoins to objects.  So once I figure this shit out I will script it.

Thanks for the example though without that I would have been lost :P

Also noticed the balls and boxes when they fall down on the floor they don't bounce, they fall as though they are heavy bowling balls or bricks :D  in normal physics objects would at least have a slight bounce when they touch the floor.  Is that a limitation or a setting ?

Thanks.
« Last Edit: April 30, 2014, 04:47:21 PM by Darkstar2 » Logged
Pages: « 1 2
  Print