Tag Info

Hot answers tagged

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


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


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


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


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


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


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


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



Only top voted, non community-wiki answers of a minimum length are eligible