GE's disadvantage? - Actor follow mouse in a bit?

Talk about making games.

Re: GE's disadvantage? - Actor follow mouse in a bit?

Postby bat78 » Sun Jun 09, 2013 1:08 am

I doubt anyone can while i can't reduce the ball's speed Hblade ^^
The future of "Game-Editor" here
User avatar
bat78
 
Posts: 816
Joined: Sun Dec 14, 2008 9:13 pm
Location: Bulgaria, Sofia
Score: 88 Give a positive score

Re: GE's disadvantage? - Actor follow mouse in a bit?

Postby skydereign » Sun Jun 09, 2013 1:14 am

bat78 wrote:I doubt anyone can while i can't reduce the ball's speed Hblade ^^

You can use the same solution I told you for your previous problem with this. Connect the actor's previous position (xprevious, yprevious) to its current position (x, y) with a line. Step through the line and find where it was supposed to collide, and handle the collision.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: GE's disadvantage? - Actor follow mouse in a bit?

Postby REDNSX » Fri Jun 14, 2013 5:16 pm

skydereign wrote:
bat78 wrote:dreign, thats drawing in canvas. I cant use canvas. I gived u game as an example what more.

I know, and I gave you a solution that didn't need canvas (as I mentioned twice). You just need to use the same idea as the example I posted.

bat78 wrote:The problem is the drawing when u move the mouse fast. It become on dots. Thats all.

The solution to this, as posted at least twice, is to create a line from the previous mouse position to the current one. This is in the same way that the example I previously posted. But since you still don't understand what that means, here is another example.



I want to do the same thing as on this file but I just want a actor to create the "line" actor. I looked at the code on this file but no luck figuring it out.
I first tried draw actor then create actor but it does not work the same way. Do you have the code for just what I want to do?

Thanks
User avatar
REDNSX
 
Posts: 237
Joined: Sun Feb 13, 2011 3:03 am
Score: 7 Give a positive score

Re: GE's disadvantage? - Actor follow mouse in a bit?

Postby skydereign » Fri Jun 14, 2013 5:23 pm

REDNSX wrote:I want to do the same thing as on this file but I just want a actor to create the "line" actor. I looked at the code on this file but no luck figuring it out.
I first tried draw actor then create actor but it does not work the same way. Do you have the code for just what I want to do?

Thanks

What is 'the "line" actor'? By what you said, all I can tell is that there is a different actor, which if that were the only change, you simply replace the call to create brush, to create line.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: GE's disadvantage? - Actor follow mouse in a bit?

Postby REDNSX » Fri Jun 14, 2013 7:47 pm

I have a actor called Line its basically a png file of a white circle about 6 pixels round. My other actor is called Pen and I want it to leave a train of the Line actor. What I want is if I move the Pen actor up and down it will leave a trail of the actor called Line like in the file you made as a example.
User avatar
REDNSX
 
Posts: 237
Joined: Sun Feb 13, 2011 3:03 am
Score: 7 Give a positive score

Re: GE's disadvantage? - Actor follow mouse in a bit?

Postby bat78 » Fri Jun 14, 2013 10:23 pm

There is a gE tutorial called "Mouse Trace" with presents a start actor (that is relative to the mouse) and when u move the mouse it leaving trail that being shorter, u will see.
The future of "Game-Editor" here
User avatar
bat78
 
Posts: 816
Joined: Sun Dec 14, 2008 9:13 pm
Location: Bulgaria, Sofia
Score: 88 Give a positive score

Re: GE's disadvantage? - Actor follow mouse in a bit?

Postby REDNSX » Fri Jun 14, 2013 11:16 pm

I will look at it when I get home . thanks!
User avatar
REDNSX
 
Posts: 237
Joined: Sun Feb 13, 2011 3:03 am
Score: 7 Give a positive score

Re: GE's disadvantage? - Actor follow mouse in a bit?

Postby REDNSX » Fri Jun 14, 2013 11:31 pm

I found the tutorial but the problem is that if I move my mouse around fast the trail gaps get bigger the faster I move. I want it that if I move the mouse fast the trail actors have the same distance from each other.
User avatar
REDNSX
 
Posts: 237
Joined: Sun Feb 13, 2011 3:03 am
Score: 7 Give a positive score

Re: GE's disadvantage? - Actor follow mouse in a bit?

Postby bat78 » Sun Jun 16, 2013 8:57 am

Thats the sense of the topic i made, its exactly because of that. The fast moving mouse causing the fps follow less.
So dreign was nice to release and give as an example his code that fixing that. You don't have to understand it, just put it :)
The future of "Game-Editor" here
User avatar
bat78
 
Posts: 816
Joined: Sun Dec 14, 2008 9:13 pm
Location: Bulgaria, Sofia
Score: 88 Give a positive score

Re: GE's disadvantage? - Actor follow mouse in a bit?

Postby REDNSX » Mon Jun 17, 2013 7:11 pm

draw (2).zip
(302.15 KiB) Downloaded 165 times



I have a file called draw2 and what I want it to do is move with my GE logo actor. Right now its off to the bottom right. I have no clue how to make it start where my GE logo actor is at. Can any one help me on this please.
User avatar
REDNSX
 
Posts: 237
Joined: Sun Feb 13, 2011 3:03 am
Score: 7 Give a positive score

Re: GE's disadvantage? - Actor follow mouse in a bit?

Postby skydereign » Mon Jun 17, 2013 7:18 pm

The reason for this is you are mixing up xmouse and ymouse. You'll notice in my code the actor creating the objects had an xy equal to the view. Therefore xscreen and yscreen coordinates worked. This isn't true for you, so in the CreateActor, you'll need to add view.x and view.y, as you want to be creating the effect at (view.x+xp, view.y+yp).
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: GE's disadvantage? - Actor follow mouse in a bit?

Postby REDNSX » Mon Jun 17, 2013 9:20 pm

So where do I put this at? In this code? where at?

Code: Select all

if(state==1)
{
    double xp = xmouse_p;
    double yp = ymouse_p;
    double ang = degtorad(direction(xmouse_p, ymouse_p, xmouse, ymouse));
    double dist = distance(xmouse_p, ymouse_p, xmouse, ymouse);
    int step = 0;
    int d = 10;
    while(step<dist)
    {
        CreateActor("brush", "RotateStar0000", "(none)", "(none)", xp, yp, true);
        xp += cos(ang)*d;
        yp -= sin(ang)*d;
        step+=d;
    }

}

xmouse_p = xmouse;
ymouse_p = ymouse;



User avatar
REDNSX
 
Posts: 237
Joined: Sun Feb 13, 2011 3:03 am
Score: 7 Give a positive score

Re: GE's disadvantage? - Actor follow mouse in a bit?

Postby skydereign » Tue Jun 18, 2013 1:52 am

You could put it where I mentioned, in the CreateActor call. Or you could put it in the beginning like so.
Code: Select all
if(state==1)
{
    double xp = xmouse_p + view.x;
    double yp = ymouse_p + view.y;
    // and so on
}
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: GE's disadvantage? - Actor follow mouse in a bit?

Postby REDNSX » Tue Jun 18, 2013 4:39 pm

Thank you!
User avatar
REDNSX
 
Posts: 237
Joined: Sun Feb 13, 2011 3:03 am
Score: 7 Give a positive score

Previous

Return to Game Development

Who is online

Users browsing this forum: Google [Bot] and 1 guest

cron