Thomas Wiborg

Member
  • Content count

    80
  • Joined

  • Last visited

Community Reputation

1573 Excellent

About Thomas Wiborg

  • Rank
    Member
  1. Where to learn 2D Math for game dev

    Yep I can program. Thanks for the tips!
  2. Where to learn 2D Math for game dev

    What kind of Math do I need to learn in order to make the games listed under. And where can I learn this kind of math, are there any newbie sites, book etc, that isent very hard? - Terraria - Mario - Diablo 1 and 2 Isometric - Plant vs Zombie - Zelda 2D RPG
  3. What should i learn to become a gamedev?

    Thanks for alot of good replies! Seems like trying/failing while programming games, and learn along the way is what we should do! Ill take this with me to my friends :)
  4. There are many roads to Rome. I know that. But what should my friends and I do if we want to become gamedevs(Programmers, we use C#)? Is it good to learn alot of basic and advance programming? Should we for example learn different sort algorithms and such things? To have a good background before jumping into gamedev? What about math? What sort of math is important to know when we want to make games as mario. Diablo 2. In other word 2d and isometric games? Other things we should learn before we hit gamedev? I known some developers jump straight into games and learn it that way. But is that better than having a solid background in basic/advance prog, math and then start creating games? Thanks for all replies -Thomas
  5. Terraria clone. What do I need to learn

    Hmmm, yes its alot to learn :) But are there any good books on 2D Game Math that you guys know of? Pref. in C#
  6. Terraria clone. What do I need to learn

    I see, pretty much alot of learning, What kind of math should i study more on? I see Tangletail says fractals. What else is good to learn?   Sean, how do you learn all those concepts, rendering, physics, etc etc... Just learning by doing? Or use google as your friend?
  7. Hello fellow programmers. I want to make a terraria clone. Ofc in alot smaller scale. And i therefor wonder what kind of skills i need to learn to do so. What is the difference between procedural generation of my map and perlin noise generating my map array. Ive tried out Perlin, to get my array filled with random numbers. Are those the same thing or am i all wrong? What other skillset do I need to learn? Im newbie so go easy on me
  8. If people wonder how i managed it.... I made this method. Now my mousePos is scaling after the resolution. Works great.   public Vector2 ReturnNewMousePosScale(float defaultComputerResolutionWidth, float defaultComputerResolutionHeight, float gameScreenWidth, float gameScreenHeight, Vector2 defaultMousePos)         {             Matrix ScaleMatrix = Matrix.CreateScale(defaultComputerResolutionWidth / gameScreenWidth, defaultComputerResolutionHeight / gameScreenHeight, 0.0F);             Vector2 Scale = new Vector2(ScaleMatrix.M11, ScaleMatrix.M22);             defaultMousePos = new Vector2(getMouseState.X, getMouseState.Y);             return defaultMousePos = defaultMousePos / Scale;         }
  9. Animation showcase -- annotations fixed

    How are progress on this game? I love the art, made it yourself?
  10. Ill take a look. Thank you Lactose!
  11. Im having some problems when running my application at fullscreen. My game is currently running at 800x600 resolution. When im in windowed mode my mouse pos x and y is 0.0 upper left corner and 800.600 bottom right. If im running my game in fullscreen its still 0.0 in upper left corner but at bottom right it changes to 1920x1080. My mouse then follows the resolution of my screen and not the applications resolution.   Is there a way to fix this, maybe a workaround or something like that? Here are my constructor for Game1.cs and Initialize   public Game1()         {             graphics = new GraphicsDeviceManager(this);             Content.RootDirectory = "Content";             Window.IsBorderless = true;             graphics.PreferredBackBufferWidth = screenWidth;             graphics.PreferredBackBufferHeight = screenHeight;             graphics.IsFullScreen = true;         }         protected override void Initialize()         {             Mouse.SetPosition(0, 0);             IsMouseVisible = true;             currentGameState = GameState.MainMenu;                          base.Initialize();         }
  12. Pong. Reflection of ball intersecting paddle

    Looks like i fixed it. R = D - 2 * dot( D, N ) * N My D was wrong inside dot. :)
  13. Pong. Reflection of ball intersecting paddle

    I got things to work now... But there is something with the Vector2.Lerp() function... I dont know what it is... But if I in the parameters set the angle to 150degree  it bounces away at -140 when going up and -40 when going down. My incoming ball degree is 39 If I change the paramtere degree in the lerp function to 140degree it bounces away up -141 and down -39.   I test this with changing the amount in the lerp function from 0 to 1. If I trie to set the angle to 170 it bounces up at -120 and down at -60... Isent this strange?   Also, the only way for me to get the angle sharper than -141 up and -39 down is to change the amount parameter in the lerp function to less than 0 and more than 1 Here is a pastebin of my code http://pastebin.com/VkWMvTVa  
  14. Pong. Reflection of ball intersecting paddle

    Yes, those are the black arrows from my picture. Their values are up to you (tweaked on game design). The values I used in the graph were Vector2( -0.707106781, -0.707106781 ) and Vector2( -0.707106781, 0.707106781 ) which is basically a normalized normal inclined -45° and 45° respectively   There is a version that takes a Vector2. But even if it weren't, you actually just need to lerp every component of the vector (X and Y coordinates) individually (in other words, two lerp calls). A value between 0 and 1. Think of it like 0% and 100%. You can use the distance in the Y component from the position of the ball to the bottom edge of the paddle divided by the height of the paddle to get the value in the [0; 1] range. Now I did all the job for you. You have the tools now. Time for you to think it through, experiment and figure some the few remainders for yourself. We learn through failure, not success. I only helped you because you seemed really stuck.   Thank you so much Matias. Yes I was EXTREMLY stuck :) Ill give you a report on how its going :)
  15. Pong. Reflection of ball intersecting paddle

    First, to reflect the ball you need the reflection vector formula.   Apply this formula with the direction of travel from the ball against the paddle's normal to get R. Examples: Ball's direction of travel =  Vector2( 0.707106781, 0.707106781 ) Paddle's normal = Vector2( -1, 0 ) R = D - 2 * dot( D, N ) * N = Vector2( -0.707106781, 0.707106781 )   Ball's direction of travel =  Vector2( 1, 0 ) Paddle's normal = Vector2( -1, 0 ) R = D - 2 * dot( D, N ) * N = Vector2( -1, 0 )   Now, this may be a little uninteresting because the Paddle's normal is always (-1, 0) across the entire border (unless you hit the top and bottom). You may want to make it more interesting by interpolating the normal between two normals at the edges, like in this picture: In black, the normals at the edges. In orange, the interpolated normal finalNormal = lerp( A, B, W ) where A & B are the two normals, and W is a value between 0 and 1 where 0 means the ball is next to A, and 1 means the ball is next to B. Google how to write a lerp function (lerp stands for 'linear interpolation').   Make sure all your vectors are always normalized, lerp doesn't always return a normalized vector even if A & B are normalized. The reflection vector should be normalized if D and N already were, but it may not hurt to renormalize it.   You can also make it more interesting by skewing the normal slightly upwards or downwards based on the velocity at the paddle is moving, so that skilled users moving the paddle too fast will not reflect the ball 100% horizontally even when it hits the exact middle (it's a way to fake friction).   Alot of great answers. But this was very good! I have a question. Im using Monogame. So i have an inbuilt lerp function. MathHelper.Lerp(); (https://msdn.microsoft.com/en-us/library/microsoft.xna.framework.mathhelper.lerp.aspx) And Vector2.Lerp()   (https://msdn.microsoft.com/en-us/library/microsoft.xna.framework.vector2.lerp.aspx) The thing is. The A and B.. is that the edges? And how should i insert them into this method? Since it parameters is float? And what is this Amount in the function?