math

  1. 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...
  2. 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...
  3. 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...
  4. 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...
  5. 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...
  6. 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...
  7. 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...
  8. 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...
  9. 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...
  10. 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...
  11. 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...
  12. 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...
  13. 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...
  14. 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?
  15. 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...
  16. 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...
  17. 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...
  18. Gasil

    GMS 2 (Solved) Help with a small math problem D':

    EDIT: Holy crap, my english is truly bad, I'm sorry about that. I meant this: Step Event. A = 15; B = 15; C = 20; if (A + B > C) { A += B - ...; } At the next step B is adding its value to A (15 + 15 = 30), however B will make A to become higher than C (30 > 20), and I don't...
  19. giraffeman210

    Drag And Drop Division symbol?

    I am using gms2 dnd and I know you can use * for multiplication but is there a symbol for division? I feel silly asking this but I can't find it for some reason Thanks!
  20. S

    GML Making mathematical graphs

    Hi there, I am using Game Maker 8.0 pro to build an evolution simulator. What I need to do now, is to write a script that could draw a cartesian graph (X-Y) from a table of values that are stored in a grid. It would be like turning the following into a continuous line on the screen: x y 1 10 2...
Top