question - code

  1. L

    State machine questione

    I am thinking about making a turn based shmup prototype. The idea is that everything including bullets do not move unless the player inputs a command. So I think how this would work is that there would be a global object that controls everything and each object reacts based on input. Am I...
  2. R

    GMS 2.3+ [Question] Is it possible to mirror/flip a Sequence?

    Hello all, I'm current experimenting with Sequences, and I'm trying to figure out how I can have a Sequence mirrored or flipped during run-time for an Object (similar to a sprite flipped using image_xscale = -1). Doing so, the same movements would occur but in the opposite direction and sprites...
  3. L

    GML Can you get a value from an object without referencing it in code?

    Due to how easy it may be to misunderstand the question, let me elaborate. for example, I want my cursor to draw the name of the object it is colliding with, one way I know how to do this, is to simply preform a simple collision check, as follows if (place_meeting(x,y,exampleobject)) {...
  4. ryan821

    SOLVED Problem when making a battle system.

    Hi, I am a new GameMaker user and I am trying to make a project that simulates battle system like undertake. The concept is when I hit enter, the battle begins. Three circles will pop up and fly up. This is the code for the circle: Create: flight_speed = 5; dir = undefined; alarm[0] =...
  5. S

    SOLVED How to change the location of a object from the original placement as it enters the room?

    New in programming, sorry for the unsophisticated languages So in my program there is a room that plays the role as the "main room", which means there are a several objects in that room and they are like entrances to other rooms, when the player object collides with one of those "entrances" it...
  6. elmwood

    GML ds_priority_delete_max() returns 0 if the data structure is empty?

    Hellow, I seem to have inadvertently discovered that ds_priority_delete_max() returns 0 if the data structure is empty (and cleared beforehand using ds_priority_clear). Why does the function return 0 at all? Why not "undefined"? Could not find an answer in the documentation.
  7. M

    GML mark of the ninja visual queue for sounds

    Hi i'm having trouble imitating the ringlike visual queue to represent the sounds. I got the the rings appearing every .5 seconds when running but I cant figure out how to erase them. they just stay there and slowly fill up the map. i was wondering if anyone can help me with that?
  8. L

    GML how to stop on frame of sprite?

    I'm trying to make something happen if the player hits enter during a certain frame of a sprite's animation. Depending on when they press enter, the sprite will then freeze on that frame. Stopping on different frames will cause different things to happen. Is there any way to write this out in...
  9. V

    GML Instance_place checks only 1 object ?

    Hi, i am making a save script for my game using instance_place. var inst = instance_place(xx,yy,all); if(inst) { var instIndex = inst.object_index; ini_write_string("Map0", string(ntp(xx))+","+string(ntp(yy)), instIndex); } Everything was okay till time that i...
  10. F

    How can I make a physics-based drawing game?

    In my physics-based-game you should be able to draw a line or any figure you want (per touchscreen or mouse) to block falling boxes. It`s also very important that some sections of the drawn line can be deleted by special projectiles. But i can`t get it to work :( - I have tried to use...
  11. C

    Problem with collisions

    I am currently making an action platformer and i have problems with collisions. The code goes like this: Create Speed = 0 Step var move = (keyboard_check (vk_right)) - (keyboard_check (vk_left)) speed = move * walkspeed If (place_meeting(x + speed, y, wall)) { While (!place_meeting (x +...
  12. C

    Puzzles in gamemaker

    I have an idea for a pretty good video game i can make and some puzzle ideas to go with it. I am not exactly sure how to implement all of them though. Block puzzles would be easy to make. Password puzzles stump me however. Maybe using variables and checking them to open a door? I can go without...
  13. T

    GML Character's Y Detection

    Hi, I need help. I am creating a game where basically there is this zombie chasing this player. I want to make it so if the zombie is under the player, and the player is still on the x axis but jumps on the y axis, I want the zombie to also jump with the player... I have spent hours trying to...
  14. T

    Game Mechanics [Question] How do I make a melee attack?

    I know how to make a shooting kind of thing I just have no clue how to make a melee attack. I messed around with hitboxes but it made no sense to me. If one of you could explain it to me that'd be great! (Im using GML)
  15. Edwin

    Legacy GM How to specify the value between one and the other value in the Switch statement

    It sounds incomprehensible, but I'll try to explain... switch (hp) { case (LOWER OR EQUALS 50) } Is it possible to set value in case that lower or greater (< or >), 'cause I want to make like when HP is lower than 50, sprite changes to another one. I know that I can use "if" statement...
  16. N

    Skip when moving

    Hi im following this tutorial on youtube, but when my character drops to the ground. it skips along the floor. and some times it get stuck in the wall. and when i hit a wall i skip again. anyone have a solution?
  17. M

    Question - Code Can't run game with a *Do* or *While* command?

    I'm very new at this and trying to make a few simple things happen. I have two objects on screen and I'm trying to make one move towards the other but stop when it gets within a certain distance. So far I've been doing all the code inside Step. I can't get it to work correctly but when I do IF...
  18. Cheesefactory

    Question - Code Using Shaders to Manipulate Tiles

    Hello, So I'm pretty new with shaders, and am wondering how to imput the coordinates of an individual pixel into the fragment shader for manipulation. I am looking to use this to manipulate a tile in-game. For example, suppose I want the pixel 2 from the top and 3 from the left of a given tile...
  19. S

    GMS 2 Keep getting a fatal error. I have 2 lines of code, please help.

    Hello! I'm new to game making/coding, can someone tell me whats wrong? I'm trying to get my character to move up/jump and its saying I have an error in line one. Can someone help me? ___________________________________________...
  20. G

    Changing from Mouse controlled weapon direction, to player moving the weapon back and forth.

    I would like to switch from using the mouse to control the direction of aiming, with the gun giving an kickback effect when fired, to just a simple back and forth control when moving my sprite around, but while still having the weapon kickback when fired. I was watching Shaun Spalding's video on...