View follows smoothly

Non-platform specific questions.

View follows smoothly

Postby Troodon » Mon Feb 19, 2007 3:00 pm

Hi,
How can I make the view follow smoothly my main actor. I don't want to make my actor the parent of the view, because in my game there is places where you wouldn't notice you are moving. I know there is some very beautifull codes here. :P
I can't die, I already tried
~on the forums since GE 1.3.3~
User avatar
Troodon
 
Posts: 1539
Joined: Thu Jan 12, 2006 3:29 pm
Location: HELL
Score: 56 Give a positive score

Postby Troodon » Mon Feb 19, 2007 3:06 pm

I found already one good which uses a invicible actor with this draw actor code:
Code: Select all
int weight = 20;

y = ((height - 1)*y + vene.y)/height;
 x = ((width - 1)*x + vene.x)/width;


Someone has something more beautifull?
I can't die, I already tried
~on the forums since GE 1.3.3~
User avatar
Troodon
 
Posts: 1539
Joined: Thu Jan 12, 2006 3:29 pm
Location: HELL
Score: 56 Give a positive score

Postby Sgt. Sparky » Tue Feb 20, 2007 2:42 am

After I fix my GE, I will show you a four way move :D
(The window got Deactivated, and when I clic kon it it beeps :cry: )
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score

Postby Troodon » Tue Feb 20, 2007 10:25 am

Ok, thanks. :D
I hope you can fix your GE soon. :wink:
I can't die, I already tried
~on the forums since GE 1.3.3~
User avatar
Troodon
 
Posts: 1539
Joined: Thu Jan 12, 2006 3:29 pm
Location: HELL
Score: 56 Give a positive score

Postby Sgt. Sparky » Tue Feb 20, 2007 11:36 pm

I just fixed it! :D
here is a four way code for the view actor,
it makes the view act like it is a camera fallownig a person :D
See my Roborunaway base game:
http://game-editor.com/forum/tp-3071-Robo-baseGame.html
:D
well,
make an actor that fallows the Player with this code for the draw actor Event for your player:
Code: Select all
KnightPointer.xscreen = xscreen;
KnightPointer.yscreen = yscreen;

and here is the draw actor event for an actor that the view fallows(The vies parent actor, like ViewParent.):
Code: Select all
if(x < KnightPointer.x - 50)
{
 xvelocity = Knight.directional_velocity+ .1;
}
if(x > KnightPointer.x + 50)
{
 xvelocity = - Knight.directional_velocity - .1;
}
if(y > KnightPointer.y + 50)
{
 yvelocity = - Knight.directional_velocity - .1;
}
if(y < KnightPointer.y - 50)
{
 yvelocity = Knight.directional_velocity + .1;
}
if(distance(x, y, Knight.x, Knight.y) < 50)
{
    directional_velocity = 0;
}

I hope it helps! :D
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score

Postby Troodon » Wed Feb 21, 2007 10:36 am

Thanks, I will try it. :)
I can't die, I already tried
~on the forums since GE 1.3.3~
User avatar
Troodon
 
Posts: 1539
Joined: Thu Jan 12, 2006 3:29 pm
Location: HELL
Score: 56 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest