step

  1. M

    GMS 2 Character movement thing

    So my character that im playing as is weird. When i first hit "d" (right) he teleports a meter away before starting to walk. Same as when i press "a" (left). It annoys me because it makes the game kind of ****. How can i fix this?
  2. C

    SOLVED Image_angle Drawing Circle Out of Sprite

    Hey all, I'm a decent programmer but new to game dev, so I was following the GM2 tutorial "My First Game - GML". I followed the instructions and when I went to test rotating my ship, instead of just rotating like the original asteroids or like the example I was following, it'd rotate, but fill...
  3. Cupid Stunt

    GML [SOLVED] The same code in a different place behaves differently

    I have a small bit of code: if(!global.round_running) { global.round_running = true; global.board = ds_list_create(); for(x_index = 0; x_index < size_x; x_index += 1) { column = ds_list_create() for(y_index = 0; y_index < size_y; y_index += 1) { y_pos =...
  4. T

    Need help with using string_width(text) method

    Hi, I am working on building an in-game textbox that requires the use of the string_width method. I ran into a problem: Let's say I have a string called "text" text = "This is my string"; When I do: var size = string_width(text) in the Step Event, I got size = 400; (this is just a random...
  5. T

    Legacy GM How to make an alarm that starts & loops in the step event ?

    I'm making an enemy object where the enemy will go on a specific path to patrol.Then he will stop at a certain point to look around for the player. I planned to make him change his sprite direction every 2 seconds(Enemies vision's for another day)but i seems to stuck here.I want the alarm to...
  6. Ellys

    GML "Draw Sprite" on click

    Hey coders, I want to draw a sprite on click and have it stay there until I click again. This is what i have so far. if mouse_check_button_released(mb_left) && position_meeting(mouse_x, mouse_y, oStats) { draw_sprite(sStatBG, 0, 400, 400); } I understand the draw function is usually in the...
  7. Andrew R. C. Beck

    GML [SOLVED] Trouble getting Collisions working in Step event of Ball

    Hi there folks! :) I am currently working on a game which is a breakout derivative in which the paddle is a ship and the ball is a ball of energy. I am using GMS1.4 and trying this code in the ball's Step event, yet the ball literally just zones through everything which does not have a separate...
  8. M

    Mac OSX Attack only playing first frame of Animation

    I'm still pretty fresh to gamemaker and am currently trying to animate a player w/ attacks. I have a character as an object and a claw (the weapon) as a separate object so that attacks can still be done in the air. Here's part of my code for the claw. This is the only part of the code that...
  9. K

    beginner question

    Hi I am beginner in game maker, and I have a question, maybe someone know this? I have code that look like this in the step event. if (var_doNothing = true) { sprite_index = spr_default; } My question is, will this then happen every frame? Will it keep on putting the sprite_index each and...
  10. T

    GMS 2 How to store an objects x position on the first step of a state

    Hello, New to GMS, first game and currently working on the movement for a platformer and I'm stuck on one particular movement. When on the ground the player is in the "grounded" state, by tapping left or right on the analogue stick the player enters the "dash" state. When in the "dash" state I...
  11. Dr_Nomz

    GML keyboard_check(vk_space) doesn't work? (instance_change)

    So I put this in the step event of my character... if keyboard_check(vk_space){ instance_change(obj_Character_ROLL,true); } But it wouldn't work. It works fine if I just put the middle bit of that code into the "spacebar" event, but why doesn't it do anything like this? EDIT: Is it a...
  12. MartinK12

    GML [SOLVED] General question - Should I split code between step and draw event?

    Many times I have to change variables and sprites according to some other variable. In example: if clicked { var1 = 1; var2 = 2; draw_sprite... image_index... image_speed.. } Should I split this into step and draw event like below so check clicked both in step and draw event? In step event: if...
  13. Dr_Nomz

    Legacy GM Any Key or Step?

    For something like checking when I press the move key or whatever, for example. Also WHY is there no detailed information about Any Key in the Manuel? That's really annoying guys. (STEP has a document...)
  14. M

    GML Passing values to new object instances

    This has been bugging me since I took up GML about a month ago, and looking for advice or suggestions on best practices. I have a spaceship game, and so far all it does it break asteroids up. The ship shoots a missile that collides with the asteroid, reduces the asteroid's health, and triggers...
  15. TheOakNuggins

    GMS 2 Instances Don't Run Code

    I've had two problems with creating instances. 1.) Animations don't play. 2.) The step event never executes. I'm trying to recreate Missile Command for school, it's due in 12 hours, and I can't figure out how to get the missiles to destroy when they collide. How I draw laser if dropTarget ==...
  16. clee2005

    HTML5 HTML5 Step event not firing

    I have a strange issue that I am hunting down so that I can report a bug and just wanted to know if anyone else has experienced this. The HTML5 export of our game mostly works, but there are objects where the step event doesn't fire. Or if it does it fires once and then no more. The Step...
  17. Y

    Question - Code How to prevent AI from going back to an inactive state?

    Hello, i'm sorry for this silly question but i have just begun studying GMS2 and don't know much about it yet. I am using the following code on a Step event to get enemies to chase the player if he gets too close to them: if (instance_exists(obj_player) && distance_to_object(obj_player) <400) {...
  18. S

    GML Can somebody explain why there is a step event in Game Maker?

    The Draw Event also has the ability of updating the code.So why is there a Step Event?????
  19. B

    Collision code glitch

    Can you solve this? The enemy can throw up to three arrows at the player at once, and the code in the normal step event for the arrow is something like this: if place_meeting(x,y,obj_player) { moveX = 0; moveY = 0; if direction >= 315 && direction <=359 || direction >=0 && direction <45 {moveX...
  20. FrostyCat

    GML What's the Difference: Loop Structures vs. Step Checks and Alarms

    What's the Difference: Loop Structures vs. Step Checks and Alarms GM Version: GMS 2.x, GMS 1.x Target Platform: All Download: N/A Links: N/A Summary: An explanation of when to use loops and when not to, plus a brief overview of non-blocking repetition Summary Many recent novices needlessly...
Top