• 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!

loop

  1. J

    GameMaker Array Draw - Column / Row Adjustments (HELP)

    I'm lacking the math ability to figure out this problem. I'm trying to draw an array in the form of columns. (4 entries per column.) // DRAW EVENT var test = [4, 0, 3, 1, 0, 5, 0, 3]; var rows = 4; // entries var columns = array_length(test) div rows; var space = 20; var pos = 0; for (var...
  2. 1

    GameMaker Black screen when running code-

    I am a beginner to using gamemaker, and i am currently making my first platformer game. I was coding the generation of coins on my map and my code was finally working, and the game ran as expected. However after making no changes to the code, i tried to run my game again and the game screen is...
  3. V

    GML My animation shoot and attack doesn`t working

    My sprites either stay in a loop or trigger too quickly and you can barely see them. animation attack #region ATTACK if key_attack { sprite_index = spr_attack if (image_index >= image_number-1) { sprite_index = spr_idle } } #endregion animation shoot #region TIRO var flipped...
  4. YoSniper

    GML [GMS2] Tracking Sound IDs to Loop

    Hello everyone. Once again, I am admitting to only recently have moved over to GMS2 from GMS1.4. One thing I used to be able to do was to loop my music such that the first part would play once, and then the middle part would loop over and over, much like in many SNES tracks. How I did this...
  5. 2

    GML Looping Room with Camera: Make Backgrounds Seamless on Loop

    I want an infinitely looping room that has a moving camera/view following the player that teleports the player back to the beginning or end based on what edge of the room the camera enters. I know how I should move the player and camera, but how would I make backgrounds loop seamlessly when that...
  6. 2

    GameMaker Check Two Digits Iterating Through a Number From Highest to Lowest

    Say I have a number like 05900512 and each two numbers represent doing something as I iterate through the number. How do I get 05 to do something based on the value then get 90 and do something based on that value until I've went through the entire number. Can you do this with decimal numbers in...
  7. alexhinton

    HTML5 audio_sound_set_track_position issue specific to html5

    Hi all, I am looping a track over my game this way: //Create aloopplay = audio_play_sound(musLoop,10,0); looplength = audio_sound_length(aloopplay); //Step if audio_sound_get_track_position(aloopplay) >= looplength - 0.3 { audio_sound_set_track_position(aloopplay, 2.2); } Basically...
  8. Yuki2out

    GameMaker Loop problem

    Hello i recently began making a boss for my game and after finishing 2 moves i told myself that this is good for a 1st LVL boss. But now i have a problem. i can't make it loop until the hp of the boss is below 0. When I put while () to it the player and everything except the music is frozen and...
  9. VisscaGem

    SOLVED Help with looping tru objects and executing a code

    Alright, what i wanna do is simple tho i have 0 ideas of how the shell am i gonna do it. I want to execute a code that check's a variable in multiple instances of an object, but i want the order of execution to be ascending based on a variable i gave said object Ex: [obj_slot-0] first it does...
  10. B

    GML [SOLVED]Multiple While conditions problem

    Hello. I'm making a code where when the RED is sighted and in circle the BLUE will automaticly find a possition where he can directly see the RED In this image i used this code with 2 separate while loops var dor = point_direction(Target.x,Target.y,x,y) var tx = Target.x + lengthdir_x...
  11. I

    Looping through all objects in a room

    I'm building a room saving system and I wanted to loop through every object in each room when you leave it so I can get the data of certain objects and save those to be loaded when you return to the room. There's a ton of different objects in each room so I can't easily just use...
  12. 2

    Legacy GM How to Avoid Looping with Div and Multiply in Example

    I'm using a while loop because I need to keep adding a value to two variables until a condition is true, but this might be possible without looping using something like div and multiplication. That could greatly reduce time for processing several of these type of things in my code that are...
  13. brinycann0nade

    SOLVED ds_grid loops running four times instead of once?

    I'm building a level editor for a game. I place 16x16px wall objects on the ground (that do their magic to add tiles etc to make them look correctly isometric) and when that's done and I hit F5, it saves it to a grid that I export as a file and import into the actual game itself. My code that...
  14. B

    GML [HELP] LOOP PROBLEM and DRAW

    Hi Guys ! i need your help on this , cause i have been thinking and thinking and i cant get this solved out. i am making a simple Soccer Manager game , where there players info are all saved in player[0,0] array player[0,1] = name "vladimir" player[0,2] = pos player[0,3] = teamid player[1,1] =...
  15. T

    GML How do I draw a list of items on multiple rows once the list has reached a certain size?

    Hi. I consider myself a decent enough programmer for the most part, but I've never quite wrapped my head around loops, beyond their most basic uses. I just recently started remaking my game's inventory system, which works fine for the most part, but one thing is driving me insane, and I know...
  16. Smidy3

    GML Help with Array for AI, ---- Solved

    Hey Everyone I’m working on a Steering AI and I am currently struggling with it. I have 16 directions (0-15), each direction works out a number from 0 to 1 using a dot_product to the nearest “target” instance and is stored into a variable with an array. When any one of the directions is = 1...
  17. D

    GameMaker Isometric view 1 line bug

    hey i'm starting my project of making a video game, problem i want to do it in an isometric view, after searching for tutorials i decided to try and code it, i did it well, but once i ve added the coding for movements the map bugged and showed only one line of tiles since i didnt know where the...
  18. FrostyCat

    GML GML Joseki Series: for Block Recipe Cards

    GML Joseki Series: for Loop Recipe Cards GM Version: GMS 2.3+ Target Platform: All Download: N/A Links: N/A Summary: A quick reference for a range of common use cases for the for loop. Summary This guide documents a number of common for loop patterns, best practices, and novice mistakes as...
  19. shortbread

    Released Looper

    Come discover the wonderful world of loops, with puzzles and challenges that will be sure to keep you on your toes! Looper is a unique puzzle action game with a variety of mechanics across 18 levels! Developed for Ludum Dare 47 Jam in 72 hrs Play / Download (HTML5 and Windows)...
  20. Z

    GameMaker move a point along path

    so i want to move a point in a path, in a loop somthing like this var i=0; repeat (path_length) { path_position++; } but how to do it? you cant set a point manually on a path. path_position is read-only.
Top