Jump to content
  • Advertisement

phil67rpg

Member
  • Content Count

    1560
  • Joined

  • Last visited

  • Days Won

    1

phil67rpg last won the day on November 15

phil67rpg had the most liked content!

Community Reputation

455 Neutral

2 Followers

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

    glutIdleFunc animation

    is there anyway to slow down the animation speed using glutIdleFunc function? void collision() { screen += 0.1667f; if (screen >= 1.0f) { screen = 1.0f; glutIdleFunc(NULL); } glutPostRedisplay(); } I have solved my previous problem.
  2. phil67rpg

    1942 plane game

    Well I have a peculiar problem. When I set my global variable screen=0.0f and I put my drawcollision_one() function in my display function it only draws a static collision sprite. However when I set my screen=0.0001f and I put my drawcollision_one() in my display function it draws an animated collision sprite. Also when I use my screen=-0.0f variable and I put my drawcollision_one() function in my collision detection function it draws a static collision sprite. However when I use my screen=0.0001f variable it does not draw anything when the drawcollision_one() function is in my collision detection function. What I want is to draw the animated collision sprite when the collision detection function is used. Let me know if you need further explanation.I am using freeglut 3.0.0 and SOIL in my program.
  3. phil67rpg

    collision sprite

    I put in freeglut in vs 2017
  4. phil67rpg

    collision sprite

    well I have a odd problem. when I set the screen variable to 0.0f I only get a static collision sprite. However when I set the screen variable to 0.0001f I get the animated sprite to work in the display function but I still get only the static collision sprite when I execute the collision detection function.
  5. phil67rpg

    collision sprite

    does anyone else want to comment on my pseudocode or my problem?
  6. phil67rpg

    collision sprite

    check for collision execute collision function set screen variable draw collision sprite animate collision sprite well I am not very good at pseudocode so here is my best shot. let me know if I can improve on it. do you of any tutorials on pseudocode
  7. phil67rpg

    collision sprite

    ok I will pseudo code this problem, also how do I solve a problem like this one, how do I work through this problem logically I want to be a better programmer.
  8. phil67rpg

    collision sprite

    well I put screen = 0.0f into my drawcollsion_one function and it draws a static collision sprite but for some reason I cant get it to animate the collision sprite. I think my glutTimerFunc function is not working properly.
  9. phil67rpg

    collision sprite

    I have made some progress, I am able to draw a collision sprite when my planes collide. all I want to do is animate the sprite sheet. here is my updated code. I just need a little hint, I have almost solved my problem. void timer(int val) { screen += 0.1667f; if (screen >= 1.0f) { screen = 1.0f; } glutPostRedisplay(); glutTimerFunc(500, timer, 0); } void drawcollision_one() { glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D, texture[3]); screen = 0.0f; glBegin(GL_POLYGON); glTexCoord3f(0.0f + screen, 0.0f, 0.0f); glVertex3f(0.5f, -0.5f, 0.0f); glTexCoord3f(0.167f + screen, 0.0f, 0.0f); glVertex3f(0.5f, 0.5f, 0.0f); glTexCoord3f(0.167f + screen, 1.0f, 0.0f); glVertex3f(-0.5f, 0.5f, 0.0f); glTexCoord3f(0.0f + screen, 1.0f, 0.0f); glVertex3f(-0.5f, -0.5f, 0.0f); glEnd(); glDisable(GL_TEXTURE_2D); } void coll_plane_one() { //draw bullet float x = -5.0f + horizontal; float y = 0.0f + vertical; float oWidth = 1.0f; float oHeight = 1.0f; //draw plane float xTwo = 5.0f + horizontal_one; float yTwo = 0.0f + vertical_one; float oTwoWidth = 1.0f; float oTwoHeight = 1.0f; if (checkCollide(x, y, oWidth, oHeight, xTwo, yTwo, oTwoWidth, oTwoHeight) == 1) { drawcollision_one(); } } my screen variable works when I set it to 0.0f, my problem is in getting the timer function to execute.
  10. phil67rpg

    collision sprite

    ok I will work on it
  11. phil67rpg

    collision sprite

    well to test my code I have the planes collide when I put an exit(0) in my collision detection algorithm it exits the screen. however when I put my drawcollision_one() function in the collision detection code it does not draw a collision sprite. thanks rutin. I am really trying to solve this problem. I am going to work on this problem more.
  12. phil67rpg

    collision sprite

    I am trying to toggle the animation sequence upon collision but it does not work for some reason, it looks like it should work.
  13. phil67rpg

    collision sprite

    it does
  14. phil67rpg

    collision sprite

    here is my collision detection function bool checkCollide(float x, float y, float oWidth, float oHeight, float xTwo, float yTwo, float oTwoWidth, float oTwoHeight) { // AABB 1 float x1Min = x; float x1Max = x + oWidth; float y1Max = y + oHeight; float y1Min = y; // AABB 2 float x2Min = xTwo; float x2Max = xTwo + oTwoWidth; float y2Max = yTwo + oTwoHeight; float y2Min = yTwo; // Collision tests if (x1Max < x2Min || x1Min > x2Max) return false; if (y1Max < y2Min || y1Min > y2Max) return false; return true; }
  15. phil67rpg

    collision sprite

    I am sorry but glutTimerfunc does work for animation but my problem is with the collision detection function
  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!