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

Started by
5 comments, last by /a/non 11 years, 3 months ago

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.

Advertisement

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).

[size=2][ 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 ]

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).

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 !

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 !

ahh ok, thanks everybody

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...

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

This topic is closed to new replies.

Advertisement