Jump to content
  • Advertisement

phil67rpg

Member
  • Content count

    1451
  • Joined

  • Last visited

Community Reputation

443 Neutral

1 Follower

About phil67rpg

  • Rank
    Contributor

Personal Information

  • Role
    Programmer
  • Interests
    Programming

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. phil67rpg

    wait loop

    void collision(int value) { board[0][0] = 1; glutPostRedisplay(); } void coll_bug_one() { float x = -0.5f + scroll; float y = -8.0f + up; float oWidth = 0.5f; float oHeight = 0.5f; float xTwo = 0.0f; float yTwo = 9.0f; float oTwoWidth = 0.5f; float oTwoHeight = 0.5f; if (checkCollide(x, y, oWidth, oHeight, xTwo, yTwo, oTwoWidth, oTwoHeight) == 1) { glutTimerFunc(1000, collision, 5); } } void coll_sprite() { if (board[0][0] == 1) { collision_bug_one(0.0f, 10.0f); glutTimerFunc(1000, collision, 5); // flag[0][0] = 1; } } void erase_sprite() { if (flag[0][0] == 1) { glColor3f(0.0f, 0.0f, 0.0f); glBegin(GL_POLYGON); glVertex3f(0.0f, 10.0f, 0.0f); glVertex3f(0.0f, 9.0f, 0.0f); glVertex3f(1.0f, 9.0f, 0.0f); glVertex3f(1.0f, 10.0f, 0.0f); glEnd(); } } I have made some progress, thanks rutin, I can draw a bug then hit it with a bullet and then it draws a collision sprite but I want it be drawn for a second and then I want it to be erased. I am close to solving my problem.
  2. phil67rpg

    wait loop

    I am sorry to ask but what do you mean by "frames"
  3. phil67rpg

    wait loop

    void collision(int v) { collision_bug_one(0.0f, 10.0f); glutPostRedisplay(); glutTimerFunc(1000, collision, 0); } void coll_sprite() { if (board[0][0] == 1) { collision(0); flag[0][0] = 1; } } void erase_sprite() { if (flag[0][0] == 1) { glColor3f(0.0f, 0.0f, 0.0f); glBegin(GL_POLYGON); glVertex3f(0.0f, 10.0f, 0.0f); glVertex3f(0.0f, 9.0f, 0.0f); glVertex3f(1.0f, 9.0f, 0.0f); glVertex3f(1.0f, 10.0f, 0.0f); glEnd(); } } I am using glutTimerFunc to wait a small amount of time to display a collision sprite before I black out the sprite. unfortunately my code only blacks out the said sprite without drawing the collision sprite, I have done a great deal of research on the glutTimerFunc and animation.
  4. phil67rpg

    Finding and Choosing Libraries for C++

    well I use opengl but there is also direct x
  5. phil67rpg

    checkers

    sorry but I am kind of slow when it comes to programming, I do make progress but it comes slowly to me.
  6. phil67rpg

    checkers

    well rutin I solved my problem, thanks for all the help
  7. phil67rpg

    checkers

    void black_piece() { if (board[5][1] == 1) { drawScene_move(); } if (board[4][0] == 1) { drawScene_move_one(); move_piece = true; } if (move_piece == false && board[4][2] == 1) { drawScene_move_two(); } } void mouseMotion(int x, int y) { if (y <= 180) { y = 180; } if (x <= 240) { x = 240; } if (y >= 420) { y = 420; } if (x >= 560) { x = 560; } board[(y - 180) / 30][(x - 240) / 40] = 1; cout << x << " " << y << endl; black_piece(); glFlush(); } here is my updated code
  8. phil67rpg

    checkers

    can anyone else help me, I am really working hard on solving this problem, I am making progress very slowly but surely.
  9. phil67rpg

    checkers

    void black_piece() { if (board[5][1] == 1) { drawScene_move(); move_piece[5][1] = true; } if (board[4][0] == 1) { drawScene_move_one(); move_piece[4][0] = true; } if (board[4][2] == 1) { drawScene_move_two(); move_piece[4][2] = true; } } void mouseMotion(int x, int y) { if (y <= 180) { y = 180; } if (x <= 240) { x = 240; } if (y >= 420) { y = 420; } if (x >= 560) { x = 560; } board[(y - 180) / 30][(x - 240) / 40] = 1; cout << x << " " << y << endl; black_piece(); glFlush(); } I have read your comments on my game. You said that my movement should be run once per cycle. Also that the mouse click should be run through an event manager. I am unclear what you mean by an event manager. however I do know how to set a Boolean that an action has taken place.
  10. phil67rpg

    checkers

    void black_piece() { if (board[5][1] == 1) { drawScene_move(); } if (board[4][0] == 1) { drawScene_move_one(); } if (board[4][2] == 1) { drawScene_move_two(); } } void mouseMotion(int x, int y) { if (y <= 180) { y = 180; } if (x <= 240) { x = 240; } if (y >= 420) { y = 420; } if (x >= 560) { x = 560; } board[(y - 180) / 30][(x - 240) / 40] = 1; cout << x << " " << y << endl; black_piece(); glFlush(); } I cut out some of my code that is not useful, but I am still getting the same problem.
  11. phil67rpg

    checkers

    please help, do you need more info?
  12. phil67rpg

    checkers

    well with my code I am able to erase a piece at the original square. Then I can drag and drop a piece at the upper left square and the upper right square. Unfortunately I can drag and drop a piece to both locations. I want to only drag and drop a piece at only one location and not at the other location.
  13. phil67rpg

    checkers

    void black_piece() { if (board[5][1] == 1) { drawScene_move(); } if (board[4][0] == 1) { flag[4][0] = true; // drawScene_move_one(); } if (board[4][2] == 1) { flag[4][2] = true; // drawScene_move_two(); } } void move_piece() { if (flag[4][0] == true) { flag[4][2] = false; drawScene_move_one(); } if (flag[4][2] == true) { flag[4][0] = false; drawScene_move_two(); } } void mouseMotion(int x, int y) { if (y <= 180) { y = 180; } if (x <= 240) { x = 240; } if (y >= 420) { y = 420; } if (x >= 560) { x = 560; } board[(y - 180) / 30][(x - 240) / 40] = 1; cout << x << " " << y << endl; move_piece(); black_piece(); glFlush(); } well I am making a checkers game using c++ and opengl. I am trying to get one piece to move from one space to another but do it only once not twice.
  14. well I recommend c++ as a programming language it has a steep learning curve but it is used by a lot of developers. I also have found that in order to get good at programming one must read and practice a lot.
  15. phil67rpg

    black jack

    well thanks to kseh I am working on a text based c++ black jack game. I am not posting a blog because I want input from those in the beginners forum, like josh petrie and kseh. I am learning a lot about c++. I don't want to post private messages because I want others to see my post.
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!