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

neob

Members
  • Content count

    123
  • Joined

  • Last visited

Community Reputation

100 Neutral

About neob

  • Rank
    Member
  1. Thank you all. You have all been very helpful.
  2. Getting a Job I’m a Computer Science major at a university with the plan of a career as a game programmer. I’m also pretty clueless on how I will get a job once I graduate. How should I search for a company? I think monster would be good, maybe gamedev.net. Once I find a company what steps should I take to apply for the job? Will I need some really good project of mine to demonstrate instead of a resume? Should it be a project that includes all my programming abilities? I will appreciate any information. Thank you all for your time, effort and helpfulness.
  3. It doesn’t matter if you went to college and transferred to a university. In my university’s computer science degree, psychology and philosophy are required. I still don’t see the connection or the reason why. If you can get microeconomics, do it. That class tends to be easy and very educational.
  4. You’re going to laugh. I forgot to do write the constructor in the class .cpp Ha-ha something so simple yet so important :) Thank you both
  5. I have a member function in a class. The class is named gameLoad. In the .h file it looks like this. int gameFunction(std::vector<unsigned char>&, unsigned long&, unsigned long&, const unsigned char*, unsigned long); In main I try to call this function this way. gameLoad load; int error = load.gameFunction(image, w, h, buffer.size() ? &buffer[0] : 0, (unsigned long)buffer.size()); However this does not compile. Compiler errors are: main.obj : error LNK2028: unresolved token (0A00035F) "public: __thiscall gameLoad::gameLoad(void)" (??0gameLoad@@$$FQAE@XZ) referenced in function "int __cdecl main(int,char * * const)" (?main@@$$HYAHHQAPAD@Z) 1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall gameLoad::gameLoad(void)" (??0gameLoad@@$$FQAE@XZ) referenced in function "int __cdecl main(int,char * * const)" (?main@@$$HYAHHQAPAD@Z) How do I go about fixing this?
  6. I would love to read something like that. You should do it if you have the time and knowledge :)
  7. Quote:Original post by Alpha_ProgDes Quote:Original post by neob So you are saying that I should: original position of the paddle - position of contact ? yes. Quote:lol that mud has lots of detritus, I cant see well in it :) I would agree with you but I don't know what detritus is [smile] But if the paddle is at y300 and the ball is hit somewhere around y600... I really dont get it
  8. I will use the constructor method, because after 11 points from either AI or P2 the game can close. However the other method would be implemented as well. I have this method startNew() that after a new "goal" has been scored it resets some variables that need to be.
  9. So you are saying that I should: original position of the paddle - position of contact ? lol that mud has lots of detritus, I cant see well in it :)
  10. Good points I shall fix them, specially the constructor. I have another question. How can I make the ball bounce off the paddle with a more realistic feeling? For example I’m doing it with rand, shouldn’t the ball be affected by the direction the paddle was moving before it hit it?
  11. I made this pong game in allegro c++. It compiles and works well for my standards. I’m posting so all the great minds here can judge it and tell me what I did wrong and what can make it better. EDITED:: Right now I’m trying to do this. How can I make the ball bounce off the paddle with a more realistic feeling? For example I’m doing it with rand, shouldn’t the ball be affected by the direction the paddle was moving before it hit it? Thank you for your time. Main.cpp #include "Pong.h" int main() { allegro_init(); install_keyboard(); Pong P; P.setGame(); return 0; } END_OF_MAIN() Pong.h #ifndef H_Pong #define H_Pong #include <allegro.h> #include <cstdlib> #include <time.h> class Pong { public: BITMAP *buffer; time_t secs; int ball_x; int ball_y; int ball_tempX; int ball_tempY; int AI_x; int AI_y; int AI_tempX; int AI_tempY; int p2_x; int p2_y; int p2_tempX; int p2_tempY; int speed; // for ball speed int hits; int AIScore; int p2Score; // Keeps track of circles direction // 1 = up and left, 2 = down and left, 3 = up and right, 4 = down and right int dir; void setGame(); void startNew(); void AIMove(); // Player 1 void p2Move(); // Player 2 void moveBall(); // Controls ball void checkWinner(); // Checks for winner and points scored void menu(); // Updates score and hits // Constructor Pong(); }; #endif Pong.cpp #include "Pong.h" void Pong::setGame() { ball_x = 400; ball_y = 240; ball_tempX = 400; ball_tempY = 240; AI_x = 31; AI_y = 255; AI_tempX = 31; AI_tempY = 255; p2_x = 753; p2_y = 255; p2_tempX = 753; p2_tempY = 255; speed = 1; hits = 0; AIScore = 0; p2Score = 0; set_color_depth(16); set_gfx_mode( GFX_AUTODETECT, 800, 600, 0, 0); buffer = create_bitmap( 800, 600 ); acquire_screen(); // background clear_to_color ( buffer, makecol( 197, 219, 191 )); draw_sprite ( screen, buffer, 0, 0 ); release_screen(); time(&secs); srand( (unsigned int)secs); dir = rand() % 4 + 1; // Check for key press to exit while( !key[KEY_ESC]) { AIMove(); p2Move(); moveBall(); checkWinner(); } } void Pong::startNew() { // comment this later clear_keybuf(); readkey(); // background clear_to_color ( buffer, makecol ( 197, 219, 191 )); // resets ball back to the middle ball_x = 400; ball_y = 240; // resets paddles after victory. AI_x = 31; AI_y = 255; p2_x = 753; p2_y = 255; speed = 1; hits = 0; } // Controls the ball void Pong::moveBall() { ball_tempX = ball_x; ball_tempY = ball_y; // Hits test for ball speed if (hits >= 30) { speed = 5; } else if (hits >= 20) { speed = 4; } else if (hits >= 10) { speed = 3; } else if (hits >= 5) { speed = 2; } if (( dir == 1 ) && ( ball_x > 5 )&& ( ball_y > 5 )) { if (( ball_x == AI_x + 15 ) && ( ball_y >= AI_y ) && ( ball_y <= AI_y + 60 )) { dir = rand() % 2 + 3; hits++; } else { ball_x -= speed; ball_y -= speed; } } else if (( dir == 2 ) && ( ball_x > 5 ) && ( ball_y < 600 )) { if (( ball_x == AI_x + 15 ) && ( ball_y >= AI_y ) && ( ball_y <= AI_y + 60 )) { dir = rand()% 2 + 3; hits++; } else { ball_x -= speed; ball_y += speed; } } else if (( dir == 3 ) && ( ball_x < 800 ) && ( ball_y > 5 )) { if(( ball_x + 5 == p2_x ) && ( ball_y >= p2_y )&& ( ball_y <= p2_y + 60 )) { dir = rand()% 2 + 1; hits++; } else { ball_x += speed; ball_y -= speed; } } else if ((dir == 4 ) && ( ball_x < 800 ) && ( ball_y < 600 )) { if(( ball_x + 5 == p2_x ) && ( ball_y >= p2_y ) && ( ball_y <= p2_y + 60 )) { dir = rand()% 2 + 1; hits++; } else { ball_x += speed; ball_y += speed; } } else { if (( dir == 1 ) || ( dir == 3 )) { ++dir; } else if (( dir == 2 ) || ( dir == 4 )) { --dir; } } acquire_screen(); circlefill ( buffer, ball_tempX, ball_tempY, 5, makecol( 197, 219, 191 )); circlefill ( buffer, ball_x, ball_y, 5, makecol( 22, 136, 11)); draw_sprite( screen, buffer, 0, 0); release_screen(); // Updates menu menu(); rest(5); } // Player 1 void Pong::AIMove() { AI_tempY = AI_y; //if on cpu's side of court if (( ball_x < 391 ) && ( AI_y > 0 )) { // 391?? i could gmake it 400 but //this makes it m,ore natural //attempt to position in the middle if ( AI_y < 183 ) { AI_y +=4; } if ( AI_y > 217 ) { AI_y -= 4; } } //if ball is close to player if (( ball_x < 117 ) && ( AI_y < 540 )) { // attempt y-axis allignment if ( AI_y < ball_y ) { AI_y += 10; } if ( AI_y > ball_y ) { AI_y -= 10; } } acquire_screen(); rectfill( buffer, AI_tempX, AI_tempY, AI_tempX + 10, AI_tempY + 60, makecol ( 197, 219, 191 )); rectfill( buffer, AI_x, AI_y, AI_x + 10, AI_y + 60, makecol ( 218, 173, 50 )); release_screen(); } // Player 2 void Pong::p2Move() { p2_tempY = p2_y; if (( key[KEY_UP] ) && ( p2_y > 0 )) { //--p2_y; p2_y -= 3; } else if (( key[KEY_DOWN] ) && ( p2_y < 540 )) { //++p2_y; p2_y += 3; } acquire_screen(); rectfill( buffer, p2_tempX, p2_tempY, p2_tempX + 10, p2_tempY + 60, makecol ( 197, 219, 191 )); // actual player 2 rectfill( buffer, p2_x, p2_y, p2_x + 10, p2_y + 60, makecol ( 29, 98, 255)); release_screen(); } // Checks for winner void Pong::checkWinner() { if ( AIScore == 11 ) { textprintf_centre_ex(screen, font, 400, 250, makecol(0,0,255),-1, "GAME OVER!!\n\n PLAYER 1 WINS!"); clear_keybuf(); readkey(); AIScore = 0; } else if ( p2Score == 11 ) { textprintf_centre_ex(screen, font, 400, 300, makecol(255,0,0),-1, "GAME OVER!!\n\n PLAYER 2 WINS!"); clear_keybuf(); readkey(); p2Score = 0; } // Checks for goal score if ( ball_x > p2_x + 20 ) { AIScore++; startNew(); } else if ( ball_x < AI_x - 20 ) { p2Score++; startNew(); } } void Pong::menu() { textprintf_centre_ex(screen, font, 50, 10, makecol(218, 173, 50),-1, "Score: %d", AIScore); textprintf_centre_ex(screen, font, 750, 10, makecol(29, 98, 255),-1, "Score: %d", p2Score); textprintf_centre_ex(screen, font, 400, 10, makecol(22, 136, 11),-1, "Hits: %d", hits); } Pong::Pong() { } [Edited by - neob on June 6, 2007 6:44:10 PM]
  12. By the way, the project is done with C++ with allegro. Though it should not affect the way the AI should be made.
  13. I have made a C++ pong clone. However I don’t know how to make AI. What do I need to do in code so that the AI paddle goes after the ball? Does anyone know a specific tutorial or example code for this? Many thanks
  14. perfect thanks. woot