Where is that demo...

Talk about making games.

Where is that demo...

Postby Game A Gogo » Fri Jun 13, 2008 1:55 am

I used to have a demo (1-2 years ago) that showed how to make like "space" movement.

Like you are a ship in space, you need to use your trust to move, and it's not direct like if it was with friction... like you can rotate but without changing your course, but when you trust, it moves smoothly towards the point you are facing...

get what I mean? D:

if so... can anyone make me a demo for that???
I lost the one I had...

(I remember the demo I had was like a rocket and you could move it around and stuff... and after 1h30 or searching... I cracked up and I am asking for help)

OFF_TOPIC=
freaky how my English improved since I first joined this forum lol, gotta keep in mind that it was like 3 years ago lol
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Re: Where is that demo...

Postby pyrometal » Fri Jun 13, 2008 2:54 am

lol, I'll make a demo! I can't garantee amazing sprites though... This is rather simple physics and yet, is really fun to toy around with!
SPRITE WARRIOR:
Free, open-source & crossplatform pixel art editor (currently under construction).
User avatar
pyrometal
 
Posts: 706
Joined: Wed Nov 28, 2007 4:07 am
Location: Kingston, ON, Canada
Score: 86 Give a positive score

Re: Where is that demo...

Postby pyrometal » Fri Jun 13, 2008 5:15 am

Here it is!

SpaceMove demo.zip
Ask questions if necessary
(10.3 KiB) Downloaded 104 times


Controls:
UP -> Accelerate in wanted direction.
DOWN -> Decelerate to velocity 0.
RIGHT -> Turn clockwise.
LEFT -> Turn counterclockwise.
SPACE -> shoot laser

I also included an extra! You can shoot lasers in any direction which has a relative velocity to the player (physics). That means, the laser gets the players original velocity PLUS its own initial velocity added to it vectorially. (its exactly like throwing a baseball out of a rolling car). The laser is set to move away from the player at a velocity of 12. The code is simple, so I didn't put comments, it should be fairly straight foward once you see it.

--pyro
SPRITE WARRIOR:
Free, open-source & crossplatform pixel art editor (currently under construction).
User avatar
pyrometal
 
Posts: 706
Joined: Wed Nov 28, 2007 4:07 am
Location: Kingston, ON, Canada
Score: 86 Give a positive score

Re: Where is that demo...

Postby Game A Gogo » Fri Jun 13, 2008 10:59 am

thx a bunch :D
this what I wanted exactly :3
just need to modify the code a bit to make it able to boost by pressing Ctrl, and make it move slower.
thx again :D

btw, here is another point :P
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Re: Where is that demo...

Postby pyrometal » Fri Jun 13, 2008 3:30 pm

I just discover that the relative velocity doesn't work very well for some odd reason... I may try to fix this...
SPRITE WARRIOR:
Free, open-source & crossplatform pixel art editor (currently under construction).
User avatar
pyrometal
 
Posts: 706
Joined: Wed Nov 28, 2007 4:07 am
Location: Kingston, ON, Canada
Score: 86 Give a positive score

Re: Where is that demo...

Postby pyrometal » Fri Jun 13, 2008 3:40 pm

Ok, to fix the problem, replace the code located in the laser's create actor event with the following:

Code: Select all
double mem = 2*PI*ROT_fraction[0]/ROT_fraction[1];

xvelocity = 12*cos(mem) + creator.xvelocity;
yvelocity = 12*sin(mem) + creator.yvelocity;
r=0; b=0;
SPRITE WARRIOR:
Free, open-source & crossplatform pixel art editor (currently under construction).
User avatar
pyrometal
 
Posts: 706
Joined: Wed Nov 28, 2007 4:07 am
Location: Kingston, ON, Canada
Score: 86 Give a positive score

Re: Where is that demo...

Postby Game A Gogo » Fri Jun 13, 2008 5:19 pm

yeah I have already seen that. but I used this instead:
Code: Select all
angle=360-ship_angle+90;
directional_velocity=creator.directional_velocity+24;

figured it would require less CPU. go see "Sneak Peak => Space Traveler" if you wanna see why I wanted these and the rotation code :3
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score


Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest

cron