Page 1 of 1

Controlling movment of ship

PostPosted: Mon Aug 30, 2004 10:19 pm
by VYTIS_KNIGHT
Say I want to do the following.

Move ship right until it gets to 98 then do not allow ship to move any further right.

move ship left until it gets to -98 then do not allow ship to move any further left.


Also:

If ship is destroyed by enemy shot then create new ship and subtract 1 from ship total. Update total on screen.

Re: Controlling movment of ship

PostPosted: Tue Aug 31, 2004 1:03 am
by zoiba
VYTIS_KNIGHT wrote:Say I want to do the following.

Move ship right until it gets to 98 then do not allow ship to move any further right.

move ship left until it gets to -98 then do not allow ship to move any further left.


on Key Down Event right
script editor
if( x<98 ) {x=x+5;}

on Key Down Event left
script editor
if( x>-98 ) {x=x-5;}

Also:

If ship is destroyed by enemy shot then create new ship and subtract 1 from ship total. Update total on screen.


you may create a timer when the ship is destroyed that re-create the ship after some time (1000 ms or so)
for the ship counter you may create an actor (let's name it ships) with an animation where each frame show a different number of ships, then subtract 1 to animpos of the actor ships everytime the player's ship is destroyed.
hope this make sense.

PostPosted: Tue Aug 31, 2004 2:56 pm
by VYTIS_KNIGHT
you may create a timer when the ship is destroyed that re-create the ship after some time (1000 ms or so)
for the ship counter you may create an actor (let's name it ships) with an animation where each frame show a different number of ships, then subtract 1 to animpos of the actor ships everytime the player's ship is destroyed.


Can you provide more direction on how to do this? Also, do you know how to keep everything not viewing till the player clicks the start button?

PostPosted: Tue Aug 31, 2004 5:40 pm
by zoiba
Can you provide more direction on how to do this? Also, do you know how to keep everything not viewing till the player clicks the start button?


try to download this:

http://www.ffx.it/GE/stopShip.zip

it's a GE project that act like I said.
there are comments inside scrips that may help you to understand.
hope this may help
bye

PostPosted: Tue Aug 31, 2004 5:55 pm
by hobgoblin
Also:

If ship is destroyed by enemy shot then create new ship and subtract 1 from ship total. Update total on screen.


u also could make an actor "total" and put

create total, scripit editor "int totalships = 100"//100 is the number of the ships u want...
destroy ship,script editor "totalships = totalships - 1"
destroy ship, creat ship

PostPosted: Wed Sep 01, 2004 12:27 am
by makslane