• Hey! Guest! The 39th GMC Jam will take place between November 26th, 12:00 UTC and November 30th, 12:00 UTC. Why not join in! Click here to find out more!

sprite_index

  1. B

    issue changing between sprites of different frame count

    The issue I'm having is that my animation is freezing on image_ index = 0 , The initial sprite in use is made up of only one image ( spr_enemy) and in the code I switch it out for spr_EnemyBP which is made up of two images. The switch is made by a boolean variable that is set to true when my...
  2. M

    Character is always facing left once any key on the keyboard is not pushed anymore.

    Hello, i'm trying to assign basic movement/collision in my game but i'm having a weird problem I can't seem to pinpoint. All I have is one character and another object to test collision against. For some reason, whenever I release a key the left facing sprite is what is instantly snapped to. Am...
  3. anjai

    Windows Animation / sprite change with sprite_index

    Hi, I have two moving objects in my document: obj_playerA and obj_playerB (playerA sticks to the bottom and and playerB to the top, both can only move left, right or jump). I used the same animation code for both, except for small changes, like any vertical stuff. For some reason it works for...
  4. B

    Animation stuck on Frame 0

    I am having an issue getting an enemy to play his death animation before he is destroyed. if(CurrentHp <= 0 && sprite_index != spr_CrowFloor) { sprite_index = spr_CrowFloor; // if(image_index == 3) // {instance_destroy();} } if i set the image_ index == 0 the code works , the...
  5. conman06

    Difference between "Image_index" and "Image_number"?

    I am very very new. I know that Sprite_Index chooses which Sprite, I think Image_index chooses which frame of a sprite, and I have no clue what Image_number does?
  6. kureoni

    walking animations mouse directioned topdown

    im not being able to use the sprite_index to change the sprite animation based on the position of the cursor on the y axis (when the mouse is above the character, we should be able to see him by his back, and when the mouse is under the character, it should be the other way around) any ideas?
  7. DavidRuiz

    GMS 2 I can't change image_speed when I change sprite_index

    Hello everybody, I'm trying to change my sprite_index, but when I do that I realized that the image_index is the same that the last time I used. How can I do to set the image_speed? "image_speed" doesn't work by the way. Thank you very much for your help! // vertical movement if frog_jump =...
  8. B

    Legacy GM [SOLVED] It's possible to leave a variable with no initial value?

    Is it possible to leave a worthless variable until a certain point in the game, even if its value grants a sprite_index a room-specific object? Or at least leave it with a default value that can later be changed by other values still in room_start? Well, whenever I start the game, I leave this...
  9. Pafbar

    How to set sprite_index to a string?

    Hello! (scroll down to see the crux of the issue) I'm making a game with RPG-style dialogue, where the different characters you talk to have different poses when they talk to you based on their emotion. The system has global variables that determine which characters are on the left and right...
  10. S

    Object only works correctly in one room.

    Hey there, I know this is so basic but could not find any previous posts that applied. I have an object that only exists to display/ change sprite based on player states. It works perfectly in roomA but always displays the same incorrect sprite in every other room. There are NPCs in these...
  11. C

    [SOLVED] Do sprites need to be in a particular order? (sprite_index)

    My game spawns randomly generated obstacles that choose from a list of sprites for a single "obj_walls" object ("spr_walls", "spr_walls1", "spr_walls2", etc...) and it it flips them along the x-axis (horizontally) when the player comes in contact with an "obj_flipper" object. It flips back to...
  12. JAG

    GML reset animation

    Hi there everyone, Im making a platformer, I have some jump and dash animations triggered with some scripts I wrote. It seems to me that whenever I set sprite_index to my eg jumping sprite, the animation does not start from the 0th frame. I tried setting image_index = 0 in my animation end...
  13. R

    Can't change sprite_index .. after changing room

    Hi everyone ! I post here, because I've a big and mysterious issue! I want to change a sprite for a blood effect, according to my player orientation (left, right, up, down). I have my sprites in arrays, because it changes according to ennemies. So I tried two ways : - I put my sprite attack...
  14. Y

    Legacy GM Really Help, Cannot set the requested sprite_index | No one?

    I have this code in my arrows (click on these to select character) image_index -= 1 (on left arrow obj) and image_index += 1 (on right arrow obj) these codes apply to cpu_object (which is the object I want to change sprite "character" ) in my selection room for that I'm using this code in the...
  15. K

    How do i update my Network Players sprite_index

    Hi, so I'm relatively new to game development and I'm currently developing an MMO and so far have multiple clients successfully connecting to my server. My local player object moves correctly and has the correct sprite movements (up,down,left,right). but I'm having a little difficulty in making...
  16. A

    [Solved] Enemy animation won't play

    ///scr_zombie_attack var dis = point_distance(x,y, obj_player.x, obj_player.y); if (dis > attackRange) { state = enemyState.FOLLOW; } else { sprite_index = spr_zombie1_attack; speed = 0; image_speed = 0.16; image_index = 0; if (image_index >= 5) { // state =...
  17. A

    Windows [SOLVED] Corrupt GM:S Install and Re-Install? (Screens)

    Hello, I was having an issue in which trying to change sprites by using "sprite_index = spr_example_sprite" would just pull the first sprite from the list of saved sprites for that project. I tried re-installing but got this "Exception" message during the install. GM:S is up-and-running now...
  18. Y

    player not working

    if keyboard_check_pressed(vk_left && !vk_shift) { //hspeed = -5 sprite_index = Spr_Player_Walk image_xscale = 1 } else if keyboard_check_pressed(vk_left && vk_shift) { //hspeed = -8 sprite_index = Spr_Player_Run image_xscale = 1 } else if...
  19. Shadowblitz16

    Legacy GM (RESOLVED) sprite_index resets itself to -1

    I just came across another issue today. for some reason my projectile objects are resetting themselves to -1 in between the Debug alarm[0] event and the Projectile step event. I followed the debugger to these points and I can't find out what is causing it. I am using a variety of code so I...
  20. F

    Legacy GM sprite_index - not sure how it works

    Hello I have important part with saving sprite_index, like a object_get_sprite(inst.object_index) I have some errors and reason can be elsewhere, but to be sure, I want to know how sprite_index works. With calling object_get_sprite(inst.object_index) I have number and this is ok. But when I...
Top