About Store Forum Documentation Contact



Post Reply 
Starting out
Author Message
Revek Offline
Member

Post: #1
Starting out
I was wondering how to code in EE, EEinit??? initPre()? ?? I am assuming init pre is ran before initializing or something given its name, and EEinit is probably like the main function in a console application. I have mostly learned C++ for console so this is new, but this is what I really want to learn.

What I want to do is properly organize my code files, (camera, main, game, menu etc..) and understand them so I can change them if need be, buying source files is great and all but not when you don't understand the code at times.
(This post was last modified: 08-08-2013 08:57 PM by Revek.)
08-08-2013 08:57 PM
Find all posts by this user Quote this message in a reply
AndrewBGS Offline
Member

Post: #2
RE: Starting out
Just don't do my mistake and start from zero with your desired project;
Make yourself some test application first, and just play around hitting random buttons and writing whatever code compiles in order to figure out what's what. I started directly working on my game and I had to go back and change my base several times, thus trashing everything I built before.

So just play around a while and see what happens. And of course, post a question here when you have a weird problem.
08-09-2013 08:13 AM
Find all posts by this user Quote this message in a reply
Revek Offline
Member

Post: #3
RE: Starting out
Well I am figuring along on my own but now I am working with a complete black screen app, please help.
08-10-2013 01:12 AM
Find all posts by this user Quote this message in a reply
TBJokers Offline
Member

Post: #4
RE: Starting out
InitPre is where the engine is loading up, also where you set application flags and name etc. DO NOT load custom data as in GUI setups etc. In the other void Init() is where you load your world up, and also setup your gui and other settings. There are several of tutorials. I recommend you testing World with Character. Pretty simple setup, where as you'll find Game::World setup in the Init. And also how to do some key bindings. You've also got bool update which is ran each frame. void Shut is called when the update loop is return false, or when you manually call it. void draw is where you are drawing GUIs and text messages. Try to keep as little calculations as possible in the draw and keep them in the update loop or somewhere else. In the renderer function which is called from the draw function you only render 3d mechanics. Do not draw GUIs here. If you follow the tutorials it should be pretty simple to work out. As there is 100's of them.
08-10-2013 01:51 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Revek Offline
Member

Post: #5
RE: Starting out
I still don't know why my code compiles and is just a black screen when I have gui from tutorials and intro logo from rpg2. I made my own code by putting snippets of other code and writing some based on what I've learned from the tutorials.

I am only using main to load up ee and StateIntro.set();, then I will go to menu, then game state. Since it compiles and runs showing no error, I am assuming the state runs, it just doesn't show up on screen.

bool init function in main.cpp reads StateIntro.set(); return true;

Then loads
Code:
ImagePtr esenthel;
/******************************************************************************/
bool InitIntro()
{
   esenthel=UID(3701074961, 1144560417, 330953344, 3868643430);
   return true;
}
/******************************************************************************/
void ShutIntro()
{
   // release pointers to free memory
   esenthel=null;
}
/******************************************************************************/
bool UpdateIntro()
{
   if(Kb.bp(KB_ESC) || Kb.bp(KB_SPACE) || Kb.bp(KB_ENTER) || Ms.bp(0) || Ms.bp(1) || Touches.elms() || StateActive.time()>=6)StateMenu.set();
   return true;
}
/******************************************************************************/
void DrawIntro()
{
   if(esenthel)esenthel->drawFs (ColorAlpha((StateActive.time()-0.5)));

}
/******************************************************************************/
(This post was last modified: 08-10-2013 03:44 PM by Revek.)
08-10-2013 02:54 PM
Find all posts by this user Quote this message in a reply
TBJokers Offline
Member

Post: #6
RE: Starting out
There's only one reason for that to not show, it's the if statement. Seems it's not loaded.
08-10-2013 04:42 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Revek Offline
Member

Post: #7
RE: Starting out
Replaced if statement with esenthel->drawFs (); it still shows black screen.

only now when it closes it says the exe has stopped working.
(This post was last modified: 08-10-2013 04:54 PM by Revek.)
08-10-2013 04:53 PM
Find all posts by this user Quote this message in a reply
TBJokers Offline
Member

Post: #8
RE: Starting out
esenthel=UID(3701074961, 1144560417, 330953344, 3868643430);

Change that instead. This is where it does not load.
08-10-2013 04:56 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Revek Offline
Member

Post: #9
RE: Starting out
It is the image I have in project, it should work. I am so frustrated with black screen.
08-10-2013 05:29 PM
Find all posts by this user Quote this message in a reply
Revek Offline
Member

Post: #10
RE: Starting out
I remove intro all together and it works, pray tell what my intro code is doing wrong?
Esc does not skip to next state.
08-10-2013 06:43 PM
Find all posts by this user Quote this message in a reply
Tottel Offline
Member

Post: #11
RE: Starting out
Check if the update is being called? Press F8 to go to Visual studio and place a breakpoint. smile
08-10-2013 08:20 PM
Find all posts by this user Quote this message in a reply
Revek Offline
Member

Post: #12
RE: Starting out
OK guys im getting the hang of it, thanks to your help guys.
08-11-2013 04:20 AM
Find all posts by this user Quote this message in a reply
Post Reply