hey everyone, I have been experimenting with different ways to create the shield, and shield effect for a game.
Instead of making an image which I can fit to the ship, which would take alot of work to resize it for each ship... I want to generate some sort of graphic using code. Ive searched and haven't seen any code trying this yet, so I was wondering if I could get some pointers in the right direction.
just so you can see what I have in mind, ill post the ignorance I was doing.
First I tried storing a DrawOval command in a variable, with variables for the current ship size.
local shieldimage = drawoval (ship.x , ship.y, imagewidth(shipimage), imageheight(shipimage))
of course i get an error, saying can't convert timage to int. So that was out.
then i tried just drawing the oval,
DrawOval(ship.x -ImageWidth(ship.shipimage)/2 , ship.y-ImageHeight(ship.shipimage)/2, ImageWidth(ship.shipimage),ImageHeight(ship.shipimage))
that was to get the oval directly over the ship. I had transparency and stuff set on it, so you can see through it.
but the oval rotates funny, and it cannt get it to rotate by its centre, so it goes around in a circle, when i turn the ship. circling the ship. auto mid handle and sethandle was no help either.
Basically i want that when the user raises the shield with the keyboard command, that the shield is now true, that part is easy, but i want the shield even though it is now "ON". to be invisible around the ship, until it is hit by projectile fire. I want to create and effect so that when it the shield glows bluish, witish sort of haze briefly then fades back to invisible....
what are some commands i can investigate to achieve this?
thanks in advance
Instead of making an image which I can fit to the ship, which would take alot of work to resize it for each ship... I want to generate some sort of graphic using code. Ive searched and haven't seen any code trying this yet, so I was wondering if I could get some pointers in the right direction.
just so you can see what I have in mind, ill post the ignorance I was doing.
First I tried storing a DrawOval command in a variable, with variables for the current ship size.
local shieldimage = drawoval (ship.x , ship.y, imagewidth(shipimage), imageheight(shipimage))
of course i get an error, saying can't convert timage to int. So that was out.
then i tried just drawing the oval,
DrawOval(ship.x -ImageWidth(ship.shipimage)/2 , ship.y-ImageHeight(ship.shipimage)/2, ImageWidth(ship.shipimage),ImageHeight(ship.shipimage))
that was to get the oval directly over the ship. I had transparency and stuff set on it, so you can see through it.
but the oval rotates funny, and it cannt get it to rotate by its centre, so it goes around in a circle, when i turn the ship. circling the ship. auto mid handle and sethandle was no help either.
Basically i want that when the user raises the shield with the keyboard command, that the shield is now true, that part is easy, but i want the shield even though it is now "ON". to be invisible around the ship, until it is hit by projectile fire. I want to create and effect so that when it the shield glows bluish, witish sort of haze briefly then fades back to invisible....
what are some commands i can investigate to achieve this?
thanks in advance
