image_angle

  1. Misael644

    Problems with the angle of a drawn line

    So, recently I put in my spaceship game a bomb system, which the player can drop to destroy nearby targets. Before the bomb is dropped, a line is drawn to show the bomb's path. But I noticed that this line is not being drawn at the correct angle of the bomb's path. Here is the code for how the...
  2. TheOnlyWRT

    Rotate a sprite without rotating its collision mask

    Hello! So I am working on a platformer where the player can roll. I have been coding the rolling motion by moving at a certain speed over a given distance and rotating the sprite using image_angle. However, with gravity, the player gets stuck in the floor. I realized that this is because using...
  3. M

    360* Joystick Rotation

    Just wanted to share some SIMPLE code I worked up to get full 360 degree rotation for GamePads (joysticks for GM8) LEFT Joystick - full 360 movement & image rotation End Step Event: hspeed = gamepad_axis_value(0,gp_axislh) // hspeed = left joystick horizontal movement vspeed =...
  4. U

    Problem with collision, but maybe with image_angle

    Hey, i'm triying to make a tetris ghost piece, but it glitchs only in this case my code is if place_meeting(x, y, solid_o){ y -= 8} if !place_meeting(x, y + 1, solid_o)and(!place_meeting(x, y + 1,wall_o)){ y += 8} if place_meeting(x, y, wall_o){ y -= 8 } the sprite have precise...
  5. Lens

    SOLVED How to make a plane loop movement?

    I have a horizontal 2D object (plane) which, after an specific event, should a loop (not the loop variable, I meant an actual 360° movement). For that to happen, I thought about having the plane's image change its image_angle to a fix temporary center, while having: I. negative vspeed (goes...
  6. J

    [Solved] Image-Angle affecting direction in Space Rocks tutorial

    I'm currently going through the space rocks tutorial and am creating the asteroid's behaviour. The tutorial tells you to change the object's image_angle each step to create a rotating effect, so that it doesn't affect the asteroid's actual direction value. When testing this behaviour, the...
  7. R

    Path and image angle and direction? How do I combine them?

    So I have a path set... and I have my object on the path... and I have the sprite set to go along with it... How do I make the image rotate to follow the path it is going on? It seems like there is just something easy I am missing but for the life of me I haven't been able to find the correct...
  8. Bawat

    GMS 2 [Solved] image_angle resets to 0

    Create event of ClawTest var ii = instance_create_deformable(player.x, player.y, spriteID); ii.image_angle = 180; Space Bar press event image_angle = 180; The above code runs fine, and I can see through the debugger, that the instance's image_angle has been set to 180. However somewhere...
  9. MaxLos

    Legacy GM Image Angle on Slopes [Solved]

    Hihi, I currently have my player object rotate whenever it's on a slope. Player rotates fine but I'm having trouble figuring out how to only rotate the player when their fully on the slope. Right now I have it set up to just draw the sprite at the right angle whenever it's colliding with a...
  10. M

    GML How to make objects rotate

    Is there any way on GMS2 to make a wand or such rotate? One side stay in one place and the other side changing position to follow the mouse? If i;m not making any sense, it is like the hands of a clock. So far i have used the code image_angle = point_direction(x, y, mouse_x, mouse_y); but the...
  11. Z

    GML image_angle checks randomly stop working mid-game

    Hi, I am currently working on my top down GTA 1 style game, and I have run into an issue. When the player is wanted by police, every 16 - 30 seconds, I want the dispatcher to announce the player's direction. ///Direction Update ///Wanted by police and driving a car if(wanted == true and...
  12. Z

    GML Spawning objects behind player at a certain distance?

    Hello, I want the police cars in my game (top down) to spawn behind the player, just off of the screen. I was thinking of creating a system where it chooses random points in the room, finds one that is a certain distance from the player, and then creates the car, but that might lead to a wall...
  13. Y

    [Solved] How to rotate an image without losing much quality

    Hello, My problem is quite easy to explain, but I don't know how to solve it. My weapon seem very good without changing the angle. I use simple angle modification to make attacks, guard, run, etc: obj_weapon.image_angle = 5*direccion; //and other angles depending on the action But the...
  14. M4nu

    Rotating a Wheel of Fortune

    Greetings to the GMC! I'm looking into spinning a wheel of fortune with the space bar. I got the constant rotating speed using image_angle and a smooth but rather sudden slowdown of the rotation. As I'm a rookie with the coding, I'm looking for advise on what to do here to have a more realistic...
  15. I

    Question - Code Need help wiht gradual image_angle

    In the main menu for a project I'm working on, I need a laser to slowly rotate infinitely. I'm new to the game maker language, and have no Idea how to make any sort of waiting function to make sure the rotation is paced, and/or doesn't crash my game. Would a wait function even be necessary?
  16. Dr_Nomz

    Legacy GM [SOLVED] How do I make the Mask not move, when the object uses image_angle?

    I have a character that looks all around via the mouse cursor, but because of how game maker works, this causes issues when looking around while hugging walls. So I figured just changing the mask would fix it, right? But no, the mask turns with the character. That said, how do I make the mask...
  17. Edwin

    GML [SOLVED] Smooth "point_direction" problem.

    VIDEO: Hello! I have a problem with the angles, using point_direction. So basically, hammer weapon (object) have this Step Event code to return the direction of mouse position: mouseDir = point_direction(x, y, mouse_x, mouse_y); image_angle += (mouseDir - image_angle) * 0.25; This works...
  18. Carl Nylander

    Question - IDE Pre rotate objects for editor

    Hello! I'd like to know if you can some how pre rotate a sprite for the editor. What I mean is that I for example have 4 objects: objSpikesW, objSpikesN, objSpikesE and objSpikesS. I'd like to use 1 sprite since they are all going to look the same but just rotated in 0, 90, 180 and 270...
  19. M

    Rotate sprite when move direction is changed

    Hey guys, I'm pretty new to programming and recently got a problem which I can't solve on my own: if (horizontalgeschw != 0 || vertikalgeschw != 0) { while (angle_difference(direction,image_angle) < 0) { image_angle += 2; } while (angle_difference(direction,image_angle) < 0) {...
  20. S

    GMS 2 [Solved] Need help with top-down rotation of character.

    Hello, I have a top-down character that consists of two objects - obj_head and obj_body. obj_head is set to always face the mouse. With obj_body, I want it to follow obj_head if obj_head's angle is greather or less than 45 degrees. This code though there is a problem with it, worked the...
Top