# Algorithm TDD and Simple Game Math

1312 views

In this Blog Entry I will translate examples from the tutorial Math for Game Developers from C++ to C# and TypeScript. I will add unit tests to the examples.

I use:

C# and TypeScript are very similar. TS has: properties and generics. TS has keywords like C#: interface, abstract (for classes and methods). Author of C# and TS is Anders Hejlsberg

## C#

Cool! I just bought one book about Maths in Game Development and your channel is very interesting.

Posted (edited)

4 hours ago, Gidrek said:

Cool! I just bought one book about Maths in Game Development

I just rewrite these simple examples from the Youtube Channel of that guy to C# and TypeScript for practice in math, programming, and TDD (writing unit tests). I think it is good to have everyday practice with math because human brain has a property to forget something that you do not use.

4 hours ago, Gidrek said:

I just bought one book about Maths in Game Development

I have a lot of book in eBook format. I study a few of them:

• 2011 - 06 - Mathematics for 3D Game Programming and Computer Graphics - 3-rd edition - Eric Lengyel -> description
• 2011 - 11 - 3D Math Primer for Graphics and Game Development - Dunn F., Parberry I -> description
• 2013 - 04 - Physics for Game Developers - 2nd Edition - David M. Bourg, Bryan Bywalec -> description -> source code
• 2014 - 05 - Physics for JavaScript Games, Animation, and Simulations - Adrian Dobre, Dev Ramtal -> description and code

And I study these lessons:

Theory is important but practice using programming is more important. I think it must be: 20% theory and 80% everyday practice.

Edited by 8Observer8

## Create an account

Register a new account

• ### Similar Content

• By Jackrin
Hi guys, it's been some weeks since i started to think to create an AI for a mobile game that i play, which can be played on PC as well so that i can use softwares
The problem is that i'm not really into "AI stuff" so i really don't know where to start, or how can my AI do what i want it to do.
In this first post i just want some tips about something my AI should do.
I'm not going to tell you all the game, because i prefer not to, and i think is not necessary either.

Ok so, one of the things my AI should do is this:
Recognise the map, the border of the map (basically the area where i can tap), it should recognise all the defenses in the map (which you can see, because you see the whole area from above),
Just this for now, i don't really know how the AI can recognise all the different defenses in the area just by seeing them, and it need to be a precise thing, we are talking about millimiters.
Maybe the AI can recreate the map in its software, but i don't know if im saying something right, so i'm just gonna leave this to you, hopefully someome will clarify thing to me.
Thanks.

Edit: just thought about the fact that i could even recreate the map by hand, with an ipotetic software with all the defenses and stats
• By QwePek
Hello, I want to make a game where i can procedurally generate caves. I found out that the best way to create this caves for me is by algorithm Perlin Worms, but I'm having problems with understanding it. Could someone explain how it works or write some code examples (best in SFML). Thanks

• Hello everyone! I have recently been developing a small game in unity for web browsers. I have noticed that the game plays slightly differently in browser vs in editor. The main thing that changes is the movement speed of the main character. I was wondering if anyone could give me a run down of things to watch out for when developing for browsers in Unity.

• Q: Hy guys , i am working on a racing game and i made the roads as a rigged model in maya (joints will control the tracks curves) , and when i imported the FBX model to UNITY i couldn't make the collider match the track when it curves , used mesh collider and feed it the skinned mesh to use to collide but it won't work , made a script to feed it the mesh realtime and it still won't , anyone knows how to do this ? (P.S: i am working on a VR game so performance is crucial)
• By congard
I have textures that are created when an application is running (for example, depth textures). And I need to transfer them to a fragment shader. The data is read from them in a loop. Now I have implemented it something like this:
uniform int activeMaps; uniform sampler2D maps [N]; ... for (int i = 0; i <activeMaps; i ++) { ... float someData = texture (maps [i], texCoord) .r; ... }
This code works well with OpenGL 3.3 on Nvidia graphics cards. But on Intel and AMD I can get the following error: error: sampler arrays indexed with non-constant expressions are forbidden in GLSL 1.30 and later. Changing to OpenGL 4.0 version, everything works fine. The first question is - will everything work well on other video cards?
Second question. If I use GL_TEXTURE_2D_ARRAY, how can I add textures, bypassing the reading of pixels from the GPU, and how can I add a ready-made texture by it id? The sample code implies that the texture data is already in the CPU and it simply passes it through glTexSubImage3D. Here is the code: