image index

  1. Wonsubon

    GMS 2 Animation Issue with Changing Sprites

    I have an object for the player with a script for the free state (there will be more scripts for other actions), and in the free state script it includes jumping, walking, crouching, and idle animations. For changing animations, I change the sprite index depending on the situation. The second...
  2. M

    instance_destroy() occuring too early

    I'm currently making a platform-esque game where 2 players are shot up into the room and have to bounce on cloud platforms to stay on-screen. I'm having issues with my instance_destroy() command, as it's preventing the clouds from spawning/destroying them too early. The code I'm using is...
  3. bob97470

    GMS 2.3+ Setting image index does not display the expected sub image

    Encountering a strange issue in regards to image_index. problem is reproduceable. create new project create sprite and resize to 96x128. (resizing may not be necessary) create 29 frames and draw the numbers 0 through 28 in them. (drawing the numbers is not necessary, but helpful to see results)...
  4. Writerstix77

    GMS 2 Coding a combination lock

    I am trying to create a 6-digit combination lock, where once the player puts in the correct combination, an item appears in another room. I have a Combo_dial_obj with 10 index images (0-9). That functions fine as far as scrolling through the numbers when clicked. However, I am having issues...
  5. N

    GML Change sprite on a SPECIFIC image index

    Greetings all, I've been dabbling with Game maker for about a month now and in a miraculous way, coding is actually starting to make sense to me, even to the point that I recently wrote some code without the use of any tutorials :) However, I've come across an issue in which it seems to be...
  6. C

    GMS 2 Help! Sprite Animation

    So I am new with GMS and I am working on some player movement. I have used a premade sprite sheet for a place holder and have used multiple sprites for a walk animation. I did some tinkering around and I was able to get it working properly (ie when the user holds "A" the sprite moves left with a...
  7. B

    Issue with button

    So I'm trying to make a button like how it is in undertale or the older zelda games. Whenever I run the game in the Compile Errors it says Object: obj_buttonA Event: Step at line 7 : malformed if statement My code is below image_speed = 0 if place_meeting(209,55,Frisk) { image_index = 1...
  8. S

    problem with set the sprite to stop

    Hi!! i don´t speak english to well but i can try... However... i'm making a shmup like gradius, r-type.. and i want to change the sprite when i press up or down, i tried a lot of different ways but it's something that i do wrong, the problem is when i want to stop the sprite at a specific...
  9. V

    Picking a random sprite without duplicates

    I am incredibly new to programming, and I am trying to have the game pick a random sprite from the image index without having any duplicates. I have the randomization working just fine, and I know I should use an array to do the rest, but I don't even know where to begin with that. This is what...
  10. S

    GML Image_Index not being evaluated as expected

    Evening all, I am looking to shift states when an animation has hit a certain frame (the cast frame), in this case represented as stateVar[0] and it is equal to 4. However, the formula evaluates false under the below circumstances, which doesnt seem right to me! It actually seems to resolve as...
  11. Bee

    GMS 2 SOLVED: Sprites and masks from strip images

    Hello all, I hope the answer to this isn't too obvious and I'm just being clueless, but I also hope there's an easy answer. I have a game generating random tiles for the play area. The tiles are all within one sprite as different image_indexes. I would like to match up their corresponding...
  12. O

    Legacy GM alarm not work

    In the Step I wrote the following code: if(image_index = 17){ alarm[0] = 5 image_speed = 0 }else{ image_speed = 1 } This code in alarm [0]: image_xscale = 1.2 image_yscale = 1.2 alarm[1] = 20 The speed of the object does become zero but nothing happens in the alarm
  13. BeowuIf

    Windows Stopping a looping animation on desired frame

    When i press the down arrow the animation keeps looping i wanted it to stop on the last frame then i found out this if (image_index==image_number-1) { image_speed = 0 } And it work once but then all the animations get messed up! here is my player step event...
  14. A

    GML Change sprite of button only once

    What I want to happen: When I press the button, a red cross appears over it (image_index = 1). After this, the sprite should stay in that state as it has already been pushed. So basically the button can only be pressed once. With my current code I, the sprite only stays in that state for one...
  15. Image index and global variables[SOLVED]

    I'm have an issue getting variables to add or subtract during a collision. I have the collision check if the image index, of the other object, is equal to global.state and this works fine when it come to destroying the instance however when it is equal it's supposed to add to global.score and...
  16. Ito

    GML When does image_index get updated according to image_speed?

    When does image_speed add or subtract its value to the object image_index? Does it happen at the beginning, or at the end of a step? I have an object whose image_index might be getting changed by some other object, and knowing where to search would help a lot. For what I understand, each...
  17. Checking sub image of sprite [SOLVED]

    I'm wondering if there is a way to check the sub image of a sprite, from one object, upon the collision of another? If so could some please help me figure it out. Basically when my player collides with an obj, I need to check the sub image before it will or will not add to a variable. It would...
  18. E

    Grass Animations...(?)

    So I'm making a top down rpg game and In it there is some grass (wow). I want to make the grass look like it's been stepped on when the player collides with it, but I am using the same grass object all throughout the map. This means that when the one grass is stepped on all of them change their...
  19. Fixer90

    (SOLVED) Multi-Footsteps?

    if(keyboard_check(ord("S"))) && (global.keylock == false) { sprite_index = spr_wplayer_walking_down; phy_position_y += 1.2; image_speed = 0.15; if(floor(image_index) == 0) && (footstep_1 == false) { audio_play_sound(snd_footstep_1, 10, false); footstep_1 =...
  20. J

    Legacy GM [solved]easier / more compact way for this code?

    greetings one and all. SO I have this code and I know it will work, but I am curious if I am missing an easier or more compact way to do accomplish the task. As it stands I will have to write 100 if statements to account for all the variables possible and that is just a bit excessive imo. I was...
Top