Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Made my own small GameEngine, but how do i reuse it fast?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
6 replies to this topic

#1 Assassinbeast   Members   -  Reputation: 271

Like
0Likes
Like

Posted 03 January 2013 - 02:56 PM

Hello.

 

I just made my small gameengine in c++ with sfml, where i have made menus, butttons, gamestates and such.

There are a lot of different files, and some images.

 

So i how do i reuse it when i have to make a new game?

Should i just copy the header files,cpp files, image folders etc into my new project?

If so, that would be tedious like to link every project with sfml... unsure.png

 

Btw, I am using microsoft visual studio express 2010.



Sponsor:

#2 Cornstalks   Crossbones+   -  Reputation: 6991

Like
1Likes
Like

Posted 03 January 2013 - 02:57 PM

I bundle my "reusable game engine" into its own library, and then when I make a new game I just link to my game engine library (and any dependencies, like SFML or whatever).


[ I was ninja'd 71 times before I stopped counting a long time ago ] [ f.k.a. MikeTacular ] [ My Blog ] [ SWFer: Gaplessly looped MP3s in your Flash games ]

#3 KnolanCross   Members   -  Reputation: 1333

Like
1Likes
Like

Posted 03 January 2013 - 03:16 PM

The easiest way is to copy the files, but you can also compile it as library, add the headers to your compiler include paths and link your project with it.


Currently working on a scene editor for ORX (http://orx-project.org), using kivy (http://kivy.org).


#4 superman3275   Crossbones+   -  Reputation: 2061

Like
1Likes
Like

Posted 03 January 2013 - 03:17 PM

Make a folder (With /lib/ and /include/) and link it!

 

However, you could have simply chose the "Library" option when creating your Game Engine's project in Visual Studio.

 

Cheers :)!


I'm a game programmer and computer science ninja ph34r.png!

Here's my 2D RPG-Ish Platformer Programmed in Python + Pygame, with a Custom Level Editor and Rendering System!

 

Here's my Custom IDE / Debugger Programmed in Pure Python and Designed from the Ground Up for Programming Education!

Want to ask about Python, Flask, wxPython, Pygame, C++, HTML5, CSS3, Javascript, jQuery, C++, Vimscript, SFML 1.6 / 2.0, or anything else? Recruiting for a game development team and need a passionate programmer? Just want to talk about programming? Email me here:

hobohm.business@gmail.com

or Personal-Message me on here smile.png!


#5 Assassinbeast   Members   -  Reputation: 271

Like
0Likes
Like

Posted 03 January 2013 - 03:18 PM

ahh ok, thanks everybody



#6 ngoaho91   Members   -  Reputation: 253

Like
0Likes
Like

Posted 04 January 2013 - 09:43 PM

hi, i've catch the same problem before.

so if you want to reuse your code, write it independently. i mean, don't do any render, or use any class, library... like sfml. use basic data structure.

for example: if you want to render a character, create 'Character' class, hold infomation for position(int), name(string), class(string), etc. your class should not have any field like Sprite, Font, Model, or any class from sfml(or any library)

and, for each library you use, create a new class named 'CharacterRender' that render the 'Character' class above. and of course, it should have Sprite, Font, Model...


Edited by ngoaho91, 04 January 2013 - 09:44 PM.


#7 /a/non   Members   -  Reputation: 148

Like
0Likes
Like

Posted 04 January 2013 - 10:40 PM

Since you're using Visual Studio, why not export the project as a template?






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS