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

DillonBroadus

Members
  • Content count

    4
  • Joined

  • Last visited

Community Reputation

109 Neutral

About DillonBroadus

  • Rank
    Newbie
  1. My brain. Wowowowowowowowowow
  2. The Shins. All day. Erry day.
  3. Well thank you very much for that tip on the SDL_EnableKeyRepeat. Here's that player::show() function. See anything strange? [source lang="cpp"]void Player::Show() { character = LoadImage(direction); Blit(x, y, character, screen); }[/source]
  4. I have made it to where it only polls once and just passes the event along. However, the input still isn't continuous and in fact it has some weird effect where when one key is pressed, instead of moving the character a continuous amount of units in that certain direction, it goes 5 units in the direction while the key is down and goes 5 again when the key is up. And also, I figure it may be a memory leak caused by maybe pointers or something, however, after a quick glance, it doesn't appear that anything funky is being done with pointers. I would show more code, however, not knowing where the problem may be, I'm not sure what portion of the code to show. However, these are the image functions which use more pointers than any other part: [source lang="cpp"]SDL_Surface * LoadImage(std::string path) { SDL_Surface * loadedImage = NULL; SDL_Surface * optimizedImage = NULL; loadedImage = IMG_Load( path.c_str() ); if(loadedImage != NULL) { optimizedImage = SDL_DisplayFormat(loadedImage); SDL_FreeSurface(loadedImage); if(optimizedImage != NULL) { Uint32 colorkey = SDL_MapRGB(optimizedImage->format, 111, 111, 111); SDL_SetColorKey(optimizedImage, SDL_SRCCOLORKEY, colorkey); } } return optimizedImage; } void Blit(int x, int y, SDL_Surface* source, SDL_Surface* destination) { Rect coords; coords.x = x; coords.y = y; SDL_BlitSurface( source, NULL, destination, &coords ); } void ColorRect(SDL_Surface* surface, int x, int y, int z) { SDL_FillRect(surface, 0, SDL_MapRGB(surface->format, x, y, z)); } void Update(SDL_Surface* surface) { SDL_Flip(surface); } [/source]
  5. Ah, well this is very strange. Polling the event inside the function or outside the function provides no differences and the program still continuously amasses a large quantity of memory it doesn't need. I'm not sure why this program works perfectly when everything's in the same source file and yet it starts acting funky when classes and multiple source files are involved.
  6. So, I've been working on a bit of game code on and off and I had the simplest operations working nicely, those being image loading and blitting, as well as some keyboard input to move a dummy character around. What I sometimes like to do is, while developing something, I'll turn my main.cpp file into a sandbox, until the stuff I'm doing works correctly and then I'll take the code, split it up and organize it into nice little files. Well, after such an organization, I found that the keyboard input was no longer continuous, even though my switch case is supposed to handle SDL_KEYDOWN and SDL_KEYUP. I've tried moving a bunch of things around, but I'm not able to get it to work correctly. Anyone have any ideas as to why? game loop: [source lang="cpp"] while (!quit) { SDL_Event event; while(SDL_PollEvent(&event)) { Chronos.GetInput(event); if(event.type == SDL_QUIT) { quit = true; } } //Chronos.Move(); ColorRect(screen, 255, 255, 255); Chronos.Show(); Blit(15, 15, img, screen); Update(screen); }[/source] Chronos.GetInput(): [source lang="cpp"]void Player::GetInput(SDL_Event event) { SDL_PollEvent(&event); switch (event.type) { case SDL_KEYDOWN: switch(event.key.keysym.sym) { case SDLK_UP: { y -= 5; direction = FACEUP; break; } case SDLK_DOWN: { y += 5; direction = FACEDOWN; break; } case SDLK_RIGHT: { x += 5; direction = FACERIGHT; break; } case SDLK_LEFT: { x -= 5; direction = FACELEFT; break; } break; } case SDL_KEYUP: switch(event.key.keysym.sym) { case SDLK_UP: { y -= 5; direction = FACEUP; break; } case SDLK_RIGHT: { x += 5; direction = FACERIGHT; break; } case SDLK_DOWN: { y += 5; direction = FACEDOWN; break; } case SDLK_LEFT: { x -= 5; direction = FACELEFT; break; } } break; } } [/source] Using Task Manager, I also noticed that my program seems to slowly add more memory to its Working Set getting upwards of 800k KB for no apparent reason and, if unchecked, would keep going. Does anyone know what a possible cause of this could be? I'm sure the former is just a novice mistake, however the latter seems strange and possibly more serious. Thanks in advance for any and all help. It is much appreciated!
  7. The polish coming off, the dream is come and gone, Love's not coming through.