• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

c_fried_rice

Members
  • Content count

    26
  • Joined

  • Last visited

Community Reputation

163 Neutral

About c_fried_rice

  • Rank
    Member
  1. This may come off as rather vague but I've been awake too long, and will post more info later if needed.   I have a state machine that deals with an abstract State class. Inherited from this are several Singleton gamestate classes. However, players will be able to transition back to certain states, and when they do I want the state to be totally reset - as if it were refreshed.   How would I go about doing this?   Thanks a ton!
  2. void SongSelect::initSongs(lua_State* L) { // code based off of code found on Google, with modifications to create the track objects WIN32_FIND_DATA file_search; HANDLE handle = FindFirstFile("Assets/Scripts/Songs/*.lua", &file_search); do { Track track; std::string song_file; std::stringstream song_file_stream; std::stringstream song_name; song_file_stream << "Assets/Scripts/Songs/" << file_search.cFileName; song_name << file_search.cFileName; std::string name = song_name.str(); song_file = song_file_stream.str(); //song_files.push_back(song_file); std::string sub_song = name.substr(0, name.size() - 4); int error = luaL_loadfile(L, song_file.c_str()); if (error) { std::cout << lua_tostring(L, -1) << std::endl; } if (lua_pcall(L, 0 , 0, 0) != 0) { std::cout<<"Error (Song Init): "<<lua_tostring(L, -1)<<std::endl; } else { track = luabind::object_cast<Track>(luabind::globals(L)[sub_song.c_str()]); Track* p_track = track.clone(); songs.push_back(p_track); } } while (FindNextFile(handle, &file_search)); FindClose(handle); } So I'm going to bump this thread. This is my new code, using Luabind instead of Luabridge. I still encounter the same issue, however I've found that it happens when I hit the lua_pcall() line for the third time. This corrupts the first two objects in the vector called songs.   Anyone have any tips on what I could do to fix the corruption issue?
  3. Apologies for the double post, but it appears the problem lies in the use of std::vector<Track>. However I can't seem to properly register a std::vector<Track> in Luabind.    I tried following the example in the luabind documentation (which admittedly is prettttty old at this stage) located here.   Anyone got any suggestions?
  4. Hey guys,    I'm trying to convert my game engine's use of luabridge to luabind, and am running into a fairly large issue:   I get this error upon trying to transition to the "SongSelect" state:     Here's some of the C++ code calling the lua script: SongSelect::Instance()->register_lua(L); int error = luaL_loadfile(L, "Assets/Scripts/States/SongSelect.lua"); if (error) { std::cout << lua_tostring(L, -1) << std::endl; } m_pGamestateManager->getStateMachine()->changeState(SongSelect::Instance()); if (lua_pcall(L, 0, 0, 0) != 0) { std::cout<< " Error (in SM transition) "<< lua_tostring(L, -1) <<std::endl; }  Here's the registration of the Luabind Module: void SongSelect::register_lua(lua_State* L) { if (L != NULL) { luabind::module(L) [ luabind::class_<SongSelect>("SongSelect") .scope[ luabind::def("Instance", &SongSelect::Instance) ] .def("init", &SongSelect::stateInit) .def("initSongs", &SongSelect::initSongs) .def("initAlbumArt", &SongSelect::initAlbumArt) .def_readwrite("bg", &SongSelect::bg) .def_readwrite("name", &SongSelect::name) .def_readwrite("font", &SongSelect::font) .def_readwrite("label", &SongSelect::label) .def_readwrite("artist", &SongSelect::artist_i) .def_readwrite("album_i", &SongSelect::album_i) .def_readwrite("title", &SongSelect::title_i) .def_readwrite("year", &SongSelect::year_i) .def_readwrite("genre", &SongSelect::genre_i) .def_readwrite("right", &SongSelect::right_i) .def_readwrite("left", &SongSelect::left_i) .def_readwrite("songs", &SongSelect::songs) ]; } } void Game::register_lua(lua_State* L) { if (L != NULL) { luabind::module(L) [ luabind::class_<Game>("Game") .scope[ luabind::def("Instance", &Game::Instance) ] .def_readwrite("title", &Game::title) .def_readwrite("x_pos", &Game::x) .def_readwrite("y_pos", &Game::y) .def_readwrite("width", &Game::width) .def_readwrite("height", &Game::height) .def_readwrite("fullscreen", &Game::fullscreen) .def_readwrite("font", &Game::font) .def_readwrite("label", &Game::label) .def("init", &Game::initialize), luabind::class_<Track>("Track") .def(luabind::constructor<>()) .def_readwrite("music", &Track::music) .def_readwrite("midi", &Track::midi) .def_readwrite("title", &Track::title) .def_readwrite("artist", &Track::artist) .def_readwrite("genre", &Track::genre) .def_readwrite("album", &Track::album) .def_readwrite("album_art", &Track::album_art) .def_readwrite("year", &Track::year) .def_readwrite("bpm", &Track::bpm) .def_readwrite("l_track", &Track::left_track) .def_readwrite("r_track", &Track::right_track), luabind::class_<GameObject>("GameObject") .def(luabind::constructor<>()) .def_readwrite("row", &GameObject::m_row) .def_readwrite("frame", &GameObject::m_frame) .def_readwrite("rows", &GameObject::m_rows) .def_readwrite("frames", &GameObject::m_frames) .def_readwrite("x", &GameObject::m_x) .def_readwrite("y", &GameObject::m_y) .def_readwrite("width", &GameObject::m_width) .def_readwrite("height", &GameObject::m_height) .def_readwrite("filename", &GameObject::m_filename) .def_readwrite("texture", &GameObject::m_texture) .def_readwrite("speed", &GameObject::m_speed) .def("init", &GameObject::init), luabind::class_<FXObject, GameObject>("FXObject") .def(luabind::constructor<>()) .def_readwrite("x2", &FXObject::m_x2) .def_readwrite("y2", &FXObject::m_y2) .def_readwrite("xc", &FXObject::m_xc) .def_readwrite("yc", &FXObject::m_yc) .def_readwrite("scale", &FXObject::m_sscale) .def_readwrite("end_scale", &FXObject::m_escale) .def_readwrite("start_alpha", &FXObject::m_startalpha) .def_readwrite("start_alpha_f", &FXObject::m_startalpha_f) .def_readwrite("alpha", &FXObject::m_alpha) .def_readwrite("end_alpha", &FXObject::m_endalpha), luabind::class_<UIObject, GameObject>("UIObject") .def(luabind::constructor<>()), luabind::class_<UIAnimator, UIObject>("UIAnimator") .def(luabind::constructor<>()), luabind::class_<UIButton, UIObject>("UIButton") .def(luabind::constructor<>()), luabind::class_<StaticUI, UIObject>("StaticUI") .def(luabind::constructor<>()) .def_readwrite("flip", &StaticUI::m_flip) .def_readwrite("alpha", &StaticUI::m_alpha) .def("init", &StaticUI::init) ]; } } Here's the lua script where the error is occurring: -- SongSelect Properties ssInstance = SongSelect.Instance(); ssInstance.name = "Song Select"; ssInstance.bg = "Assets/Art/Song Select/bg.png"; -- Artist Icon ssInstance.artist = StaticUI(); ssInstance.artist.filename = "Assets/Art/Other/placeholder.png"; ssInstance.artist.texture = "Artist Icon"; ssInstance.artist.frames = 1 ssInstance.artist.rows = 1 ssInstance.artist.frame = 1 ssInstance.artist.row = 1 ssInstance.artist.x = 15; ssInstance.artist.y = 415; ssInstance.artist.width = 35 ssInstance.artist.height = 35 ssInstance.artist.speed = 1; ssInstance.artist.flip = false; ssInstance.artist.alpha = 255; ssInstance.artist:init(ssInstance.artist.x, ssInstance.artist.y, ssInstance.artist.width, ssInstance.artist.height, ssInstance.artist.filename, ssInstance.artist.texture, ssInstance.artist.flip); -- Album Icon ssInstance.album_i = StaticUI(); ssInstance.album_i.filename = "Assets/Art/Other/placeholder.png"; ssInstance.album_i.texture = "Album Icon"; ssInstance.album_i.frames = 1 ssInstance.album_i.rows = 1 ssInstance.album_i.frame = 1 ssInstance.album_i.row = 1 ssInstance.album_i.x = 15; ssInstance.album_i.y = 450; ssInstance.album_i.width = 35 ssInstance.album_i.height = 35 ssInstance.album_i.speed = 1; ssInstance.album_i.flip = false; ssInstance.album_i.alpha = 255; ssInstance.album_i:init(ssInstance.album_i.x, ssInstance.album_i.y, ssInstance.album_i.width, ssInstance.album_i.height, ssInstance.album_i.filename, ssInstance.album_i.texture, ssInstance.album_i.flip); -- Title Icon ssInstance.title = StaticUI(); ssInstance.title.filename = "Assets/Art/Other/placeholder.png"; ssInstance.title.texture = "Title Icon"; ssInstance.title.frames = 1 ssInstance.title.rows = 1 ssInstance.title.frame = 1 ssInstance.title.row = 1 ssInstance.title.x = 15; ssInstance.title.y = 485; ssInstance.title.width = 35 ssInstance.title.height = 35 ssInstance.title.speed = 1; ssInstance.title.flip = false; ssInstance.title.alpha = 255; ssInstance.title:init(ssInstance.title.x, ssInstance.title.y, ssInstance.title.width, ssInstance.title.height, ssInstance.title.filename, ssInstance.title.texture, ssInstance.title.flip); -- Year Icon ssInstance.year = StaticUI(); ssInstance.year.filename = "Assets/Art/Other/placeholder.png"; ssInstance.year.texture = "Year Icon"; ssInstance.year.frames = 1 ssInstance.year.rows = 1 ssInstance.year.frame = 1 ssInstance.year.row = 1 ssInstance.year.x = 15; ssInstance.year.y = 520; ssInstance.year.width = 35 ssInstance.year.height = 35 ssInstance.year.speed = 1; ssInstance.year.flip = false; ssInstance.year.alpha = 255; ssInstance.year:init(ssInstance.year.x, ssInstance.year.y, ssInstance.year.width, ssInstance.year.height, ssInstance.year.filename, ssInstance.year.texture, ssInstance.year.flip); -- Genre Icon ssInstance.genre = StaticUI(); ssInstance.genre.filename = "Assets/Art/Other/placeholder.png"; ssInstance.genre.texture = "Genre Icon"; ssInstance.genre.frames = 1 ssInstance.genre.rows = 1 ssInstance.genre.frame = 1 ssInstance.genre.row = 1 ssInstance.genre.x = 15; ssInstance.genre.y = 555; ssInstance.genre.width = 35 ssInstance.genre.height = 35 ssInstance.genre.speed = 1; ssInstance.genre.flip = false; ssInstance.genre.alpha = 255; ssInstance.genre:init(ssInstance.genre.x, ssInstance.genre.y, ssInstance.genre.width, ssInstance.genre.height, ssInstance.genre.filename, ssInstance.genre.texture, ssInstance.genre.flip); -- Right Track Icon ssInstance.right = StaticUI(); ssInstance.right.filename = "Assets/Art/Other/placeholder.png"; ssInstance.right.texture = "Right Icon"; ssInstance.right.frames = 1 ssInstance.right.rows = 1 ssInstance.right.frame = 1 ssInstance.right.row = 1 ssInstance.right.x = 15; ssInstance.right.y = 590; ssInstance.right.width = 35 ssInstance.right.height = 35 ssInstance.right.speed = 1; ssInstance.right.flip = false; ssInstance.right.alpha = 255; ssInstance.right:init(ssInstance.right.x, ssInstance.right.y, ssInstance.right.width, ssInstance.right.height, ssInstance.right.filename, ssInstance.right.texture, ssInstance.right.flip); -- Left Track Icon ssInstance.left = StaticUI(); ssInstance.left.filename = "Assets/Art/Other/placeholder.png"; ssInstance.left.texture = "Left Icon"; ssInstance.left.frames = 1 ssInstance.left.rows = 1 ssInstance.left.frame = 1 ssInstance.left.row = 1 ssInstance.left.x = 15; ssInstance.left.y = 625; ssInstance.left.width = 35 ssInstance.left.height = 35 ssInstance.left.speed = 1; ssInstance.left.flip = false; ssInstance.left.alpha = 255; ssInstance.left:init(ssInstance.left.x, ssInstance.left.y, ssInstance.left.width, ssInstance.left.height, ssInstance.left.filename, ssInstance.left.texture, ssInstance.left.flip); -- FONTS ssInstance.font = "Assets/Fonts/ostrich-bold.ttf"; ssInstance.label = "ostrich16"; -- Init Songs ssInstance:initSongs(); ssInstance:initAlbumArt(ssInstance.songs); ssInstance:init(); Can anyone tell me what I'm doing wrong?   Thanks!
  5. Hey guys,   So I'm trying out Luabind as an alternative to Luabridge, but am struggling to get my game to work with it. I'm encountering this error:     Has anyone encountered this linker issue with Luabind before? I'm using VS2012, and can't figure out what the cause is. =\   Help would be appreciated!
  6. Hrm, I did that but it just printed out each individual character. =S   Anyone have any suggestions for trying to bind my initSongs() function to Lua so I can call it in my lua script and return a std::vector?   Or does anyone have any suggestions on another way to do this with Lua and luaBridge?   Thanks!
  7. class Track { public: Track(); void init(); ~Track(); std::string music; std::string midi; std::string title; std::string artist; std::string genre; std::string album; int starting_track; std::string year; int bpm; std::string left_track; std::string right_track; StaticUI* album_art; unsigned int elapsedTimeMS; }; That's the Track class, it's basically just a container for the necessary variables. Now for a stupid question, how can I easily get a Hex Dump of my output? >.>
  8. So I printed out some of the values and have copied them below. The first batch is when the songs are being gathered in the initSongs() function. The second batch is after it's called in init(). N/A Kevin Macleod Blown Away Electro Rock 2012 Assets/Audio/Songs/Playable/kevin_macleod_blown_away/kevin_macleod_blown_away.mid Assets/Audio/Songs/Playable/kevin_macleod_blown_away/kevin_macleod_blown_away.ogg 00AEAC14 00AEAC0C 00AEAC08 00AEAC10 00AEAC1C 00AEAC04 00AEAC00 The Hunter Mastodon Dry Bone Valley Metal 2011 Assets/Audio/Songs/Playable/mastodon_dry_bone_valley/mastodon_dry_bone_valley.mid Assets/Audio/Songs/Playable/mastodon_dry_bone_valley/mastodon_dry_bone_valley.ogg 00AE8624 00AE861C 00AE8618 00AE8620 00AE862C 00AE8614 00AE8610 Origin of Symmetry Muse Plug In Baby Alternative 2001 Assets/Audio/Songs/Playable/muse_plug_in_baby/muse_plug_in_baby.mid Assets/Audio/Songs/Playable/muse_plug_in_baby/muse_plug_in_baby.ogg 00AE881C 00AE8814 00AE8810 00AE8818 00AE8824 00AE880C 00AE8808 The Slip Nine Inch Nails 1,000,000 Industrial 2008 Assets/Audio/Songs/Playable/nin_1000000/nin_1000000.mid Assets/Audio/Songs/Playable/nin_1000000/nin_1000000.ogg 00AD6CB4 00AD6CAC 00AD6CA8 00AD6CB0 00AD6CBC 00AD6CA4 00AD6CA0 Hesitation Marks Nine Inch Nails Came Back Haunted Industrial 2013 Assets/Audio/Songs/Playable/nin_came_back_haunted/came_back_haunted_nin.mid Assets/Audio/Songs/Playable/nin_came_back_haunted/Came Back Haunted.ogg 00AE58D4 00AE58CC 00AE58C8 00AE58D0 00AE58DC 00AE58C4 00AE58C0 Psybrid Theory Rosalina Sama & Triple Q One Style Closer Mash Up 2013 Assets/Audio/Songs/Playable/rosalinasama_one_style_closer/rosalinasama_one_style_closer.mid Assets/Audio/Songs/Playable/rosalinasama_one_style_closer/rosalinasama_one_style_closer.ogg 00AEB614 00AEB60C 00AEB608 00AEB610 00AEB61C 00AEB604 00AEB600 xQ± 2012 < Assets/Audio/Songs/Playable/kevin_macleod_blown_away/kevin_macleod_blown_away.ogg 00AEAC14 00AEAC0C 00AEAC08 00AEAC10 00AEAC1C 00AEAC04 00AEAC00 Mastodon Dry Bone Valley Metal 2011 Assets/Audio/Songs/Playable/mastodon_dry_bone_valley/mastodon_dry_bone_valley.mid Assets/Audio/Songs/Playable/mastodon_dry_bone_valley/mastodon_dry_bone_valley.ogg 00AE8624 00AE861C 00AE8618 00AE8620 00AE862C 00AE8614 00AE8610 Origin of Symmetry Muse Plug In Baby 2001 Assets/Audio/Songs/Playable/muse_plug_in_baby/muse_plug_in_baby.mid Assets/Audio/Songs/Playable/muse_plug_in_baby/muse_plug_in_baby.ogg 00AE881C 00AE8814 00AE8810 00AE8818 00AE8824 00AE880C 00AE8808 Nine Inch Nails Industrial 2008 Assets/Audio/Songs/Playable/nin_1000000/nin_1000000.mid Assets/Audio/Songs/Playable/nin_1000000/nin_1000000.ogg 00AD6CB4 00AD6CAC 00AD6CA8 00AD6CB0 00AD6CBC 00AD6CA4 00AD6CA0 Hesitation Marks Nine Inch Nails Came Back Haunted Industrial 2013 Assets/Audio/Songs/Playable/nin_came_back_haunted/came_back_haunted_nin.mid Assets/Audio/Songs/Playable/nin_came_back_haunted/Came Back Haunted.ogg 00AE58D4 00AE58CC 00AE58C8 00AE58D0 00AE58DC 00AE58C4 00AE58C0 Psybrid Theory Rosalina Sama & Triple Q One Style Closer Mash Up 2013 Assets/Audio/Songs/Playable/rosalinasama_one_style_closer/rosalinasama_one_style_closer.mid Assets/Audio/Songs/Playable/rosalinasama_one_style_closer/rosalinasama_one_style_closer.ogg 00AEB614 00AEB60C 00AEB608 00AEB610 00AEB61C 00AEB604 00AEB600
  9.   So this is what a .lua file in Song Select looks like: -- Lua Constructor music_track = Track(); -- Audio music_track.music = "Assets/Audio/Songs/Playable/kevin_macleod_blown_away/kevin_macleod_blown_away.ogg"; -- Midi Note Charts music_track.midi = "Assets/Audio/Songs/Playable/kevin_macleod_blown_away/kevin_macleod_blown_away.mid"; -- Song Info music_track.title = "Blown Away"; music_track.artist = "Kevin Macleod"; music_track.genre = "Electro Rock"; music_track.album = "N/A"; music_track.album_art = StaticUI(); music_track.album_art.filename = "Assets/Audio/Songs/Playable/kevin_macleod_blown_away/aa_1.png"; music_track.album_art.texture = music_track.album; music_track.album_art.frames = 1; music_track.album_art.rows = 1; music_track.album_art.frame = 0; music_track.album_art.row = 0; music_track.album_art.x = 5; music_track.album_art.y = 100; music_track.album_art.width = 256; music_track.album_art.height = 256; music_track.album_art.speed = 1; music_track.album_art.flip = false; music_track.album_art.alpha = 255; music_track.album_art:init(music_track.album_art.x, music_track.album_art.y, music_track.album_art.width, music_track.album_art.height, music_track.album_art.filename, music_track.album_art.texture, music_track.album_art.flip); music_track.l_track = "Synth"; music_track.r_track = "Drums"; music_track.year = "2012"; music_track.bpm = 135; So yes, I would say it's defined anew in every Lua file. I guess my question then is, why would this work fine when launched from VS2012 but not fine when launched directly from an .exe in a folder WITH the assets folder and all necessary libraries included?   And should it be an issue with redefinition, how would I fix that?   Thanks!
  10. Unfortunately, I don't think that's it because I've made sure that the Assets directory is copied into the /Release and /Debug directories when I try to run it outside of Visual Studio. It's also important to note, that this problem only has appeared since adding in the code for the select screen. =S
  11. Hey guys, I have a pretty MAJOR issue with some of my code for a game I'm working on.   Basically, I have the following code to find all the lua scripts and then grab some information from them on a selection screen. It works fine when I run it from Visual Studio 2012 (as both release and debug) but doesn't appear to function properly. Some pictures don't appear, and some random text characters appear instead of the actual text, and in some place there's on text whatsoever. I don't have any include how to debug this to be honest.   Here's the code that initializes all the stuff. void SongSelect::init(GamestateManager* gameStateManager, lua_State* L) { m_pInputManager = InputManager::Instance(); ImageManager* m_pImageManager = ImageManager::Instance(); Game* m_pGame = Game::Instance(); AudioManager* m_pAudioManager = AudioManager::Instance(); songs = initSongs(L); std::cout << "Attemping to read songselect.lua\n"; luaL_dofile(L, "Assets/Scripts/States/SongSelect.lua"); std::cout << "Read songselect.lua\n"; m_pImageManager->load(bg, "bg", m_pGame->getRenderer()); current_pad = old_pad = NULL; initAlbumArt(songs); info_col.a = 200; info_col.r = 255; info_col.g = 255; info_col.b = 255; TextManager::Instance()->loadText(font, label, 36); selected = 0; } std::vector<Track*> SongSelect::initSongs(lua_State* L) { std::vector<Track*> tracks; // code based off of code found on Google, with modifications to create the track objects WIN32_FIND_DATA file_search; HANDLE handle = FindFirstFile("Assets\\Scripts\\Songs\\*.lua", &file_search); while (handle != INVALID_HANDLE_VALUE) { std::string song_file; std::stringstream song_file_stream; song_file_stream << "Assets\\Scripts/Songs\\" << file_search.cFileName; song_file = song_file_stream.str(); song_files.push_back(song_file); luaL_dofile(L, song_file.c_str()); Track* track = luabridge::getGlobal(L, "music_track"); tracks.push_back(track); if (!FindNextFile(handle, &file_search)) { break; } } FindClose(handle); return tracks; } Any ideas why this may work when run from Visual Studio 2012 but not when launched directly from Windows Explorer in a different location? It makes it kind of hard to playtest/ release the game if I can't even get it to run properly on other computers!   Thanks a ton!
  12. Oooh that makes sense. My only remaining question then is where/how to define the table if I'm reading in the values for for great_t, etc. and great, etc. from a script? Because as it stands I can't define the table in a header file, because the values will not have been read in, and defining it in my init() function gives me a syntax error about incomplete types when I go to use sizeof(timing_table).   Thanks!
  13. Hey guys!   Sorry for the poorly titled thread. Basically I'm working on a music game, and want there to be an accuracy factor to when the player hits the note. My current code is as follows: void Gameplay::detectHit(note_buttons pressed, double time) { if ((note_gems_left.empty() && current_track == &note_gems_left) || (note_gems_right.empty() && current_track == &note_gems_right)) { return; } if (current_track == &note_gems_left) { if (pressed == notes_left_s.front()->getButton()) { if (time <= notes_left_s.front()->getTimeStamp() + great_t && time >= notes_left_s.front()->getTimeStamp() - great_t) { score += points * great; note_hit = GREAT; note_gems_left.erase(note_gems_left.begin()); notes_left_s.erase(notes_left_s.begin()); } else if (time <= notes_left_s.front()->getTimeStamp() + nice_t && time >= notes_left_s.front()->getTimeStamp() - nice_t) { score += points * nice; note_hit = NICE; note_gems_left.erase(note_gems_left.begin()); notes_left_s.erase(notes_left_s.begin()); } else if (time <= notes_left_s.front()->getTimeStamp() + good_t && time >= notes_left_s.front()->getTimeStamp() - good_t) { score += points * good; note_hit = GOOD; note_gems_left.erase(note_gems_left.begin()); notes_left_s.erase(notes_left_s.begin()); } else if (time <= notes_left_s.front()->getTimeStamp() + poor_t && time >= notes_left_s.front()->getTimeStamp() - poor_t) { score += points * poor; note_hit = POOR; note_gems_left.erase(note_gems_left.begin()); notes_left_s.erase(notes_left_s.begin()); } else { note_hit = MISS; note_gems_left.erase(note_gems_left.begin()); notes_left_s.erase(notes_left_s.begin()); } } else { note_hit = MISS; } } else if (current_track == &note_gems_right) { if (pressed == notes_right_s.front()->getButton()) { if (time <= notes_right_s.front()->getTimeStamp() + great_t && time >= notes_right_s.front()->getTimeStamp() - great_t) { score += points * great; note_hit = GREAT; note_gems_right.erase(note_gems_right.begin()); notes_right_s.erase(notes_right_s.begin()); } else if (time <= notes_right_s.front()->getTimeStamp() + nice_t && time >= notes_right_s.front()->getTimeStamp() - nice_t) { score += points * nice; note_hit = NICE; note_gems_right.erase(note_gems_right.begin()); notes_right_s.erase(notes_right_s.begin()); } else if (time <= notes_right_s.front()->getTimeStamp() + good_t && time >= notes_right_s.front()->getTimeStamp() - good_t) { score += points * good; note_hit = GOOD; note_gems_right.erase(note_gems_right.begin()); notes_right_s.erase(notes_right_s.begin()); } else if (time <= notes_right_s.front()->getTimeStamp() + poor_t && time >= notes_right_s.front()->getTimeStamp() - poor_t) { score += points * poor; note_hit = POOR; note_gems_right.erase(note_gems_right.begin()); notes_right_s.erase(notes_right_s.begin()); } else { note_hit = MISS; note_gems_right.erase(note_gems_right.begin()); notes_right_s.erase(notes_right_s.begin()); } } else { note_hit = MISS; } } } My main issue is that I feel like this could be done in a MUCH better way. I'm just not sure how to go about it. Basically there are different accuracy levels for hitting the note - ranging from MISS to GREAT (with POOR, GOOD, & NICE in between). It affects the score, and the amount of "life" the player has.   Anyone got any suggestions?   Thanks a ton!
  14. Ah, yes silly me. It turned out the path name for the image was being read in as "" as opposed to a string that wasn't empty. 'Twas a silly mistake in the Lua file where I read in the path for the image.   Thanks a ton though! 
  15. Yeah, I'm using a gamestate manager by using a basic FSM. Each state gets its own update() function, etc.   But my problem now seems to be adjusting the alpha of the image. I tried using the function listed here, but I never see the image on the screen, despite my debugger hitting the line where the draw should happen. =S   Can anyone explain what kind of value I should be giving the function I linked to? I've been doing the suggestion you had Servant, and then multiplying 255 by that but it doesn't seem to work, even when the value of the alpha variable is .9 for example (255 * .9 therefore should give an alpha value of ~229).