Tag Info

New answers tagged

0

Read Real-time Collision Detection. By far the best on the subject imho. Implement Spacial Partitioning of the objects in your scene. (kd-tree or octree or etc...) This is by far one of your most important components (when it comes to simulation [like col. det.] or rendering) Implement a Bounding Volume Hierarchy (BVH) for your objects - grouping the ...


1

What about GUI, sound, asset / resource management, levels / maps, quests etc.? These are all good candidates for scripts. Most of the game can typically be written in a scripting language. Typically the only thing that may require being written in the core language (C, C++, C#, Java, etc) is anything that is performance critical or core game ...


1

Whatever's most amenable to encapsulation or is already well specified - and thus well encapsulated - in C++ classes / functions, i.e. exists behind a stable, solid interface. Aspects that are ever-changing, and aspects that are coded at a low level and need fine control like rendering and low-level network code, are poor candidates for scripting. It ...


0

According to 50%, 30%, 20% proportions, myScore = (numberOfCoins * 0.5) + (numberOfStars * 0.3) + (numberOfLives * 0.2); But if you want lives to be more important you must redefine the proportions; (i.e 30% for coins, 20% for stars, 50% for lives). That could be achieved by just changing the multiplication factor of the numberOfCoins, numberOfStars, ...


4

You don't set these values in the shader. You set them in your program, generally when first creating the texture (though it can be set or changed whenever). If you've already uploaded your texture data to OpenGL then all you have to do is this: First bind the texture if it is not already. glBindTexture(GL_TEXTURE_2D, texture_id); Then set the ...


1

This is most likely a rounding error. I'm guessing that x and y are ints. Keeping track of the x and y values as floats, I expect will fix the issue. Consider if the values are being floored: Moving Left 10 - 1.6 = 8 Moving Right 10 + 1.6 = 11


4

Music Unsurprisingly, slowing down the music currently playing will immediately let the player know the game has slowed down. Alternatively, you can play completely different music to indicate a change in the game's pace, or even play no music at all. A common way to complement changes in music is to play a transition sound to ease into it rather than ...


0

I'd say the best thing to do would be to save game data when somethings changed as sometimes the game may end up force closing which would result in losing all your data


2

Gameplay Design Technically, it depends on the style of gameplay you are designing. In some game genres, it is almost explicitly expected to have certain "save types". For instance, in online casual flash adventure/RPG games, you will often save every tiny change into a cookie so if the player accidentally (or intentionally) closes the browser, the game ...


0

If your game is addictive as I hope, and after 1 hour plaing, a black-out or a pc crash , make me loose all progress.. i regret you do not added an in game autosave. Basicaly you missed option 1.5 save sometime (time related, level changing)


5

There are many ways to implementing scripting in game engines, or applications in general. Most conventional scripting languages are just like any other library. Just as libpng interprets a particular data format and provides APIs to read the results of processing that format, a scripting language library like Lua read in a particular format (Lua source ...


3

I can give one small piece of advice. Don't do this in your render loop: viewMat = getUniformLocation(sp, "viewMat"); modelMat = getUniformLocation(sp, "modelMat"); projMat = getUniformLocation(sp, "projMat"); maxIterLoc = getUniformLocation(sp, "maxIterations"); centerLoc = getUniformLocation(sp, "center"); scaleLoc = getUniformLocation(sp, "scale"); ...


1

If you have to handle a large set of keys have a look at: SDL_GetKeyState which gives you a snapshot of the state of the whole keyboard.


1

Book contents usually fall under the copyright of the author. Software developed based on the source code from the book (no matter how much or little you change) is a derived work, meaning you need the permission of the copyright holder. However, it is usually not in the interest of a textbook author to sue people for following their advice. Some books ...



Top 50 recent answers are included