Jump to content


desmasic

Member Since 11 Apr 2005
Offline Last Active Private

Topics I've Started

Creating Projectile Following Image_angle?

14 May 2009 - 08:27 AM

- I have a 130(w) x 131(h) main sprite (which is rotated at origin using mouse x/y) with origin set to X=65 and Y=30 (that is, not at the tip of the sprite where you'd expect the projectile to come).

- Now I am rotating the sprite using image_angle and tried create a moving sprite with X and Y set to 0, Speed = 10 and direction set to direction.

- The projectile sprite is 64x114 with origin set to center (10 frames animation).


THE PROBLEM:
The projectile doesn't come out at the direction I want it to (at the Y=125 of the first sprite, which is the tip) even if I try setting direction + 100 (or something like that). Sprite just shows up at the center of the main sprite.


Any ideas?

Basically I want the projectile to come out of the tip of the main sprite, but the main sprite's origin is set to the other end (sprite rotates at the origin following mouse x/y). Obviously, the tip is rotated and the projectile is stuck at one direction no matter what I do (setting direction doesn't seem to make it follow).

Controlling Mouse Speed/sensitivity?

12 May 2009 - 04:50 PM

I am using image_angle to rotate a sprite using mouse at it's origin. The only problem is that the sprite rotates too fast since I can't seem to find a way to reduce mouse speed/sensitivity.

Is there a way to do this? (with GML) I just want the sprite to be rotatable at a sane pace with mouse.  :blink:



EDIT: I even tried setting mouse_x.speed.. but that was just a guesswork and it never was going to work anyway. :)

Boundry Around Sprites With Alpha..

25 December 2008 - 08:49 AM

I found some topics in search but I am trying to find some other way that using the GML option for sprites with alpha. I am mostly using pre-rendered sprites so I export to PNG with alpha (even TGA sometimes, depends). I read somewhere about GM using bottom left pixel to create image alpha, so  guess that pretty much is the big problem since I am getting black borders around most sprites.

Is there a way to solve this border problem with images using alpha (without GML)? (and no, editing so many sprites is not the option unless I want to take forever creating one game  ;) )

EDIT: I must say I am very confused with the way alpha works in GM. Sometimes light colored images show up just fine against a dark background (as alpha). Other times I have to screw around with background colour (usually end up with black/dark blue/dark green) to get the light coloured sprites to show up fine. It's annoying.

Changing Player And Enemy Depth.. Doubledragon

25 November 2008 - 11:21 AM

I am changing the Player's depth using depth +=1; everytime the player presses the Up key (if you know Double Dragon, that's the kind of player movement I am trying to get to work).

Now the thing is, I can move the player up and down on-screen without changing depth, but the problem is when you shoot, the bullets hit enemies no matter where you are (since they are using same depth as well). Now everytime the player presses up/Down key, I want to increase/decrease depth (-=1 / +=1).. which I tried but doesn't seem to work. Is there a proper way to do this?

Oh and the moment player reaches specific distance (400), the enemy starts moving towards the player. So how do I make the enemy change the depth to move to the player's depth by itself?

Thanks.

EDIT: Think I found the solution.

EDIT2 : Still need to know how to change other units depth according to the player. I figured out how to change the player depth but still trying to make enemies change their on the fly. ^_^

EDIT 3: Problem solved thanks to yosher and senaku. :)

EDIT 4: A problem remains unsolved (post below).

Instance Not Getting Destroyed Outside The View..

24 November 2008 - 09:51 PM

I have no idea why, but I have tried setting Outside view 0 / Boundary view 0 / Outside Boundary / Intersect Boundary events to destroy the bullet instance (all these events were inside the bullet object) when it's outside the view (I am using View 0 = 1024 x 768 boundary around player object), but it doesn't work, bullets still hit enemies outside the player view.

Now of them all, Outside view 0 kinda works , except for the fact that no matter where I move with the player (with the view), the bullets don't show up at my current position for the player object (that is, bullets show up in the starting position view only). Any ideas?  ;)