math

  1. O

    3d Collision method that allows rotation

    So what im looking for is a little complicated to explain, but it feels like it should be pretty easy. ill explain the best i can. Im making a 3d project and i currently have AABB collision implemented and it works great but it feels limiting since nothing can rotate (other than appearance, the...
  2. kamiyasi

    Help me with some math surrounding triangle strips

    Hi there. I'm making this text box using triangle strips. The tip of the text box arrow can point anywhere on screen (currently using the mouse position). Right now though, the border around the tip of the text box arrow does not have a consistent width, which I would like it to. As you can see...
  3. RyanC

    GML Question about Gravity vs Scale & Lerps

    Hi All, I have been trying to make a ghost on my platform game which basically records the users game play and plays it back again. The issue I'm facing is that on different scales the ghost does not perform correctly. About the game mechanics. player x position is generally fixed, with the...
  4. Selva

    SOLVED Left or Right? Making this... *Solved* ...and I feel dumb.

    So. I updated GMS2 as soon as I went back to making games. I was... out for a while. I'm using IDE version 2.3.1.542. A lot has changed. Anyway. I'm using GML for this project. My missile needs to know whether it needs to turn left or turn right to arc it's way towards the supposedly doomed...
  5. If Programable_Matter

    Finding the Sum of an Array in the Step event

    I've tried to find the sum of an array by using the following code CREATE EVENT for loop...... value[1] = 1 value[2] = 1 all the way to value[40] and every single one is worth the value one STEP EVENT for i=1; i<=40; i++) { global.sum = global.sum + value } The problem is (like expected) it...
  6. M

    GMS 2.3+ Fast Bezier curve generator (any degree)

    GM Version: 2.3.0 Target Platform: ALL Download: N/A Links: Formula for Bezier curve, My source code (may drift), Vectors, Vector valued functions, Combinations, Pascal's Triangle and Combinations Summary: A fast bezier curve generator. Takes any amount of focus points and returns a list of...
  7. flyinian

    SOLVED Assistance with a combat system.

    I am trying to create a combat system for my game and I need assistance with the following. playerkill = 10; enemydefense = 9; enemyhealth = 10; when the player attacks the enemy, the enemy defense will negate the player kill and the remainder would then be taken away from the enemy's...
  8. figures

    2D topdown tile collision, keep moving if not blocked in one direction when moving diagonally

    Hi, So basically I used an example 2D tile collision method from medium.com and have made some slight changes to improve it for my situation. It works great for 32px x 32px sprite and 16px tileset. I'm trying to figure out what I need to do to add "wall sliding": What I mean is basically say...
  9. kamiyasi

    How to calculate a bell curve?

    I am trying to figure out the math for a Gaussian Function or Normal Distribution bell curve. This is the equation given for this, but I'm having trouble figuring out how to make use of it for my purposes. This is what I need to be able to do: Input the following values: The width of the...
  10. tomtinderbox

    GMS 2 How to calculate steps needed for lerp() to hit target value in step event?

    Greetings, I'll come in hard and true: I suck at mathematics. I know that: xx = lerp(xx, 10, 0.25); Can also be written as: xx = xx + ((10 - xx) * 0.25); Let's say I give xx a starting value of 100 in a create event and I put the lerp() function above in the step event. How can I calculate...
  11. Xor

    Discussion Interesting Math

    A couple days ago I asked the question "If there was a clock that halves it's speed every 12 hours, when would it reach midnight?". This spurred a long discussion about different ways to interpret the problem and a variety of answers. Which brings to my attention that there are several people...
  12. Freddie The Potato

    3D Find Intersection in Rectangular Prism With Directional Vector

    Hola! While writing a script to resolve 3D collisions, I encountered a problem and I can't quite figure it out! I have a rectangular prism with varying width, height and depth. I also have a point located within this prism (A) and a normalized directional vector (d). If a ray is cast from A...
  13. HayManMarc

    GMS 2 (SOLVED)Calling math wizards! (help making arc)

    Hey all, Are you ready? MATH CHALLENGE!! Are you excited? I hope you're excited. Actually, I'm hoping someone around here is great with maths and can help me out. I do okay with math, and can usually, eventually find the answer for things that are not too complicated, but this one is...
  14. PhallicSpleen

    [SOLVED] finding ellipse intersection with line

    I've been trying to figure this out for a while and haven't found the answer. Given: Height of ellipse, Width of ellipse, Xposition of vector, Ypostion of vector, Direction of vector. Find the distance to the edge of the ellipse starting at the vector (x,y) and moving in its direction. I've...
  15. mbeytekin

    quaternion to 2d angle

    I've a little personal project about converting mocap data from 3ds max ASE file to Spine skeletons. I have no idea about quaternion conversions and after searching forum I found quaternionGetx and other scripts by Slayer64 But after trying a lot of combinations couldn't get usable results...
  16. Binsk

    Asset - Scripts UBG Math [vectors, quats, and matrices]

    I don't know about you but I really get tired of re-implementing vector and matrix math for every 3D project started. This extension is my solution. I decided to make a professional library that integrates well as if included in the engine by default. You can purchase the extension via the...
  17. Divinik

    GML Make status bar stay the same size?

    I'm a bit of a math dummy, I was wondering if it was possible to make a, for example, health meter stay the same size, even if the character's max health went up?
  18. FloresSottile

    Random with memory

    I'm working on a game that helps kids develop math quickness in times table exercises and I'm trying to figure out what's the best approach to put on screen exercises randomly but with memory, so that every round a new exercise appears, but its multiples are different than the ones in the...
  19. P

    Need help with simple equation

    Hi everyone, I'm having completing what I feel is probably a simple equation to complete a simple action. What I'm trying to do is make a simple lighting system. I have an object "oLight" and as I walk past it, my shadow casts in the opposite direction. It works well, however, I'd like to make...
  20. Edwin

    GML Need help with comparing expressions.

    Hello, friends! I've got a little question about comparing values with if condition, so when I check the value if it's equal to 0, I check if it's value is equal to 0.0000 or it's value is between the 0.0000 and 0.9999? Some of my variables have non-integer values in my game. So if my first...
Top