• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

for loop

  1. M

    [SOLVED] There has to be a better way (for/repeat loop optimisation)

    Context: I've made a simple algorithm that loops through data and creates a series of path points, but the end result is a path with thousands of points - which is extremely slow to calculate in a later bit of code - so I'm working on a way to strip the path of redundant data (that is, points...
  2. D

    [ RESOLVED ] Inventory - Item Pick-up Problem

    Can anyone help with this issue. I think it has to do with the arguments, but I don't have a good handle on using them yet. I've converted some code from a 1d array into a 2d array. Now I'm trying to use a Right Mouse click event to pick up an item off the floor. My sample item is just a red...
  3. J

    Legacy GM Script problem [SOLVED] (Thanks to "Aura" and "FrostyCat")

    Hey, i have a problem with a script in gm: studio The script should look for the index of array argument[0] of 0 and overwrite it with argument[1] scr_array: ///scr_array(array,write) //array[6] = argument[0] var write = argument[1] for(global.i=0;global.i=6;global.i++){ if...
  4. M

    Windows (Solved) Using for loop to create/place objects (problem)

    Hi folks I've been having a problem with the for loop. I'm probably just not understanding completely how it works yet, but... Here's my goal/problem: an object that, when created, instantly places objects around itself in a grid pattern. Here is the code that I am using to try and make this...
  5. O

    Legacy GM For loop in the Destroy event [SOLVED]

    The issue was being caused by a part of the code that protected the player from new asteroids being spawned on top of them. There were a few fixes, including disabling that feature (not desirable!), disabling destruction of asteroids while invincible, or stopping the child asteroids from...
  6. W

    [SOLVED]FOR loop problem in drawing event

    Hi, I'm having a horrible time trying to get this FOR loop to work correctly, I will explain it first. What it's supposed to do: takes segments from an image and draws them in order 1 time to make a complete new image while background_showcolour=false, then a picture is taken of the image...
  7. SquiggleyPete

    Legacy GM help with draw event for inventory with for loops

    Hello. Using GMS Pro vers. 1.4.1757. I posted not long ago about help setting up arrays to define my inventory. Thanks to community responses, I think I have that under control; now what I'm having trouble with is drawing the inventory correctly. Currently, when I pick up an item, it draws...
  8. T

    Objects overlap instead of using i++ position

    EDIT: Rephrased the question to be more concrete In this example i've got an array in my create event that places three objects on top of each other. When my player collides with an object in the game, i want it to check if the first slot in the array is empty (image_index =0) and change it...
Top