Controlling movment of ship

Talk about making games.

Controlling movment of ship

Postby VYTIS_KNIGHT » Mon Aug 30, 2004 10:19 pm

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.
VYTIS KNIGHT
VYTIS_KNIGHT
 
Posts: 29
Joined: Tue Jun 15, 2004 2:33 am
Score: 0 Give a positive score

Re: Controlling movment of ship

Postby zoiba » Tue Aug 31, 2004 1:03 am

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.
User avatar
zoiba
 
Posts: 45
Joined: Mon Aug 09, 2004 9:44 am
Location: Italy
Score: 1 Give a positive score

Postby VYTIS_KNIGHT » Tue Aug 31, 2004 2:56 pm

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?
VYTIS KNIGHT
VYTIS_KNIGHT
 
Posts: 29
Joined: Tue Jun 15, 2004 2:33 am
Score: 0 Give a positive score

Postby zoiba » Tue Aug 31, 2004 5:40 pm

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
User avatar
zoiba
 
Posts: 45
Joined: Mon Aug 09, 2004 9:44 am
Location: Italy
Score: 1 Give a positive score

Postby hobgoblin » Tue Aug 31, 2004 5:55 pm

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
__________

i'm noob =P
__________
hobgoblin
 
Posts: 97
Joined: Sat Feb 21, 2004 5:10 pm
Location: BEHIND YOU!!!
Score: 0 Give a positive score

Postby makslane » Wed Sep 01, 2004 12:27 am

makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score


Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest

cron