Jump to content
  • Advertisement

Jiggle156

Member
  • Content Count

    15
  • Joined

  • Last visited

Community Reputation

100 Neutral

About Jiggle156

  • Rank
    Member
  1. I was thinking recently, whilst I have a relatively good theoretical knowledge of C++ and other languages, I don't have anything concrete to show for it. Yeah, I've done all the typical console applications whilst learning to program etc. - and a few of the abstract mathematical ones from places like Project Euler - but nothing "real world." I have made half assed attempts at tetris and other games, but have then stopped doing them to get on with school work etc. - and not gone back to them. So I was wondering, if anyone could provide me with some practical, real world programming tasks - perhaps directly from the workplace, or maybe just a link to something, because I haven't been able to find anything of the sort online. I feel this would be really helpful to me, and perhaps to other programmers in a similar situation.
  2. Jiggle156

    Walking in front of/behind sprites

    Ah! It makes perfect sense now, thanks Couple of further questions that sprung to mind though - should the player be tile based (given that the legs etc, will have collision, but the head etc - should be drawn on top of other sprites - so that it can stand "in front" of them. Also - do you think using alpha with overhead sprites - such as the roof of a building, will cause a slowdown?
  3. Jiggle156

    Walking in front of/behind sprites

    Thanks for your replies. Say I wanted to make it strictly tile based - and I wanted a house that I could walk behind - say 3*2 - the bottom 3 tiles could have collision, and the top 3 (roof) didnt - drawing from top to bottom, in the order that you suggested - would allow me to walk behind ?
  4. In a traditional 2d rpg style game - how can the character be able to walk in front of and behind the spites? eg - can walk in front of a house, but be partially concealed behind it.
  5. I was recently reading a tutorial about a simple 2D game engine, and no - im not making an engine, im making a game. A stack was used for both game states and processes, and left me a little confused. Link: http://content.gpwik...ine_System_Core Can someone please explain to me, using examples - how stacks can be used to manage states and processes in a game, and why this is preferable to say - a switch statement?
  6. Jiggle156

    SDL_Rect Precision Issues

    Whole problem resolved by changing the reflection calculation to: varx = -varx; and vary = -vary;
  7. Jiggle156

    SDL_Rect Precision Issues

    Well I just simplified the reflection massively by taking the negative inverse of the vector - but its still overlapping: The collision code takes the ball (SDL_Rect) and the bat/border (SDL_Rect) and checks if any edges overlap. Then: if (test_collision(Ball, Wall) == true || test_collision(Ball, Wall2) == true) { float temp = varx; varx = -(vary); vary = temp; BALLX += (varx * v); BALLY -= (vary * v); std::cout << "BAT COLLISION AT: " << int(BALLX) << ", " << int(BALLY) << std::endl << std::endl; } else if (test_collision(Ball, Top) == true || test_collision(Ball, Bottom) == true) { float temp = varx; varx = vary; vary = -(temp); BALLX += (varx * v); BALLY -= (vary * v); std::cout << "WALL COLLISION AT: " << int(BALLX) << ", " << int(BALLY) << std::endl << std::endl; } else { BALLX += varx * v; BALLY -= vary * v; } The BALL and var variables are floats - that are then casted and added to the rect later. Another problem is also cropping up. At random collisions the ball will go back the way that it came, instead of being reflected perpendicular to its entry angle :/
  8. I am currently making a Pong clone - and im facing a big problem with the collision system (Uses floating point vectors).<br />Due to the typecasting from float to int (SDL_Rect's x and y values are integers)- I am losing quite a lot of precision, and its making the collision behave strangely. What is the typical workaround for this kind of thing? Also - when I apply a higher scalar value - the ball goes over the collision boundaries into the objects a little. It's only by 1 with a scalar of 1, but with 5 it goes over by about 3-4 ... Really confused
  9. Jiggle156

    Need help with 2D Vectors

    Okay then - well I had a go at Pong today using vectors - for the most part it went well. So far I managed it by giving the ball an initial vector, finding the unit vector, multiplying this by the velocity and then moving it. When it hits the paddle I used R = 2(V.N) - V (Where R is the reflected vector, V is the initial vector, and N is the normal) to calculate the reflection. Is this the best way to be doing it? What would be a good method of collision detection for pong? (Given that all rectangles are axis aligned) What should I do about SDL_Rectangles? (Given that the x/y values are integers. Should I just cast the them before collision detection?) Could anyone suggest a class structure for representing vectors? (Do I need to store the direction separately?) Any help will be greatly appreciated
  10. Jiggle156

    Need help with 2D Vectors

    Okay, well I understand that - but how are things like the dot product, and multiplication/addition of vectors used... I don't really understand.
  11. I am struggling a little to understand the topic of vectors, in relation to 2D game programming. I have a relatively good grasp on how they work, but no idea how to apply this knowledge to say, moving a character. Could someone please help explain this to me? Possibly with example code or a decent tutorial?
  12. Hi there! I recently started a Tetris-Clone, which isn't going too well due to a lack of planning. I have some code written, but it contains elements from different ideas that I had over the course of a couple of days, and whilst some of the code is still useful - this project is unlikely to go anywhere without some direction. Could someone please explain how to make an effective plan for an OO game? Thanks in advance
  13. I am currently writing a Tetris clone game, and due to a lack of knowledge on how to plan properly - its becoming...challenging. I have written a fair amount of code already, but it's all over the place - and probably only makes sense in my head, so perhaps best not to post it here. But anyhow, I am using a 2D array of boolean values to deal with collision. A brick will be randomly created, and bound to the base pointer controlled by key events. I understand how its going to move, and collide with things - but I have absolutely no idea what to do when it hits the bottom. How should I make it 'stay around', once the block is deleted, and a new one bound? Note: Using C++, SDL and this is my first game project.
  14. Jiggle156

    Fundamentals of Game Programming?

    Okay then, so I'll have a bash at Tetris, and see how that goes. Is it acceptable to post the code on the forums for people to make suggestions? Thanks Apoch
  15. Firstly - New to the forums: Hello all! Before I ask my questions, a little background info: I have a fair knowledge of C++, have been learning/using it on and off for a touch over a year - I have a firm grasp on most concepts. With regard to game development, I have played around in S.D.L a little, but I am relatively new to game design. ------------- I was reading around, trying to decide on the best way forward - and this led to me believing that I needed to create a simple game engine. After getting a cold hard reality check, I have realized that in order to get anywhere with something as complicated as game design, I'm going to have to start with small, completable projects, and work my way up (I was considering a Tetris clone). Does anyone have any guidance they could offer? Note: I am particularly confused as to what level to approach this from. Should I be creating a simple, procedural program? or should I be using state/process managers and complex class structures. Any help would be greatly appreciated
  • 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!