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

Talk about making games.

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

Postby bat78 » Mon Jun 03, 2013 8:30 pm

Hello developers,
One think murdering me in gE. It disallow me to finish my game also x:
I tried with all possible codes that makes the actor to follow mouse (including Follow Mouse O_o) And i noticed that the actor do not follow the mouse in bits.
Like.. the actor need time before he gets to the mouse, if you move the mouse faster.
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 » Mon Jun 03, 2013 8:55 pm

So you want the actor to follow the mouse with a delay? If you don't want it to accelerate, you can just do this.
Code: Select all
angle = direction(xscreen, yscreen, xmouse, ymouse);
directional_velocity = 10;

It is only slightly trickier if you want it to accelerate, but you can use vectoradd to achieve smoother movement.
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 bat78 » Mon Jun 03, 2013 8:57 pm

I doubt it will work. Its just the xmouse/ymouse.
I have noticed that the coordinates xmouse nad ymouse just do not respond as the original mouse coordinates if you move the mouse faster.
Maybe we can use ceil(); on xmouse/ymouse. I just don't know about this..

You know drawing into a canvas. I wan't that. Like immediately positioning actor to the mouse. Like drawing without canvas.
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 » Mon Jun 03, 2013 9:03 pm

So you want the mouse to have a bullet physics like effect. That is to say it moves over an area faster than a frame, you would still want it to register mouse events for all actors it passed through. Yes? Generally this isn't possible due to the nature of how gE handles frames. However you can do one of two things. Increasing the fps will allow gE to detect more transition states when the mouse moving. This isn't perfect. The other is to assume the mouse moved in a straight line from the previous mouse position to the current one. If you are using canvas as a drawing tool, this is rather effective. Otherwise, you can create mouse actors that handle collision events with whatever actor you wanted the mouse over event (rather inefficient, but it gets the idea across).
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 bat78 » Mon Jun 03, 2013 9:04 pm

So you want the actor to follow the mouse with a delay?

No, i wan't the oposite. The actor to follow the mouse with NO DELAY.
If u can notice, while using xmouse/ymouse, the actor have delay in following mouse if u move the mouse faster.
Also if u compare it in bits. You only have to move mouse really slow to be 1 : 1.

The example on gE for using xmouse and ymouse (with the star) u know it. It looks like drawing with the star. And u can see it. It is not like drawing when u move the mouse faster, it becomes on dots.
How it should be: --------------------------
How it is: - - - - - (if u move the mouse faster)
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 bat78 » Mon Jun 03, 2013 9:08 pm

If actor can have an collation with canvas's setpen then there is no problem. Since i think its not possible, i want to draw like that, but with an actor - with means
using follow mouse events - like xmouse and ymouse. But yes.. moving mouse faster cause xmouse/ymouse not exact. Just frames must be more...faster idk o-o
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 » Mon Jun 03, 2013 9:11 pm

bat78 wrote:The example on gE for using xmouse and ymouse (with the star) u know it. It looks like drawing with the star. And u can see it. It is not like drawing when u move the mouse faster, it becomes on dots.
How it should be: --------------------------
How it is: - - - - - (if u move the mouse faster)

I don't actually know it, but this problem can be fixed with the method I mentioned in my last post. All you need to do is keep track of the previous xmouse/ymouse values, and do this.
Code: Select all
moveto(xmouse_prev, ymouse_prev);
lineto(xmouse, ymouse);

And that will draw a smooth line between the two. Now, the higher the fps the more accurate this technique will be. Note it is still possible without the canvas actor, you just need to make sure to connect them in the same way (that 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 bat78 » Mon Jun 03, 2013 9:12 pm

moveto & lineto is in case u can use canvas and set a pen in. But i can't.
My game style do not allow me. This class of games are rare (Maybe because in all platforms they have similar bugs) but one think is sure - It sounds easy on theory.
So maybe u know that: http://www.buzzedgames.com/draw-ball-2-game.html - Take attention on the specific drawing there. Ball collade with a drawed patch.
Its created with Java but we both know C++ is more advanced then Java. The Java is just more easy.
Well im making game like that (MUCH more advanced) And thats the only problem.
I will share the credit with u (the game's database is completely mine) If we can figure out how we can build that.
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 bat78 » Wed Jun 05, 2013 5:33 pm

what do u think about this algorithm:
Code: Select all
distance(ball.x, ball.y, xmouse, ymouse)/directional_veloicity;
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 Hblade » Wed Jun 05, 2013 6:47 pm

You can also use min, max after that to set how fast it can go, meaning it follows the mouse smoothly but has a limited speed :)
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

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

Postby bat78 » Wed Jun 05, 2013 8:03 pm

xscreen = xmouse;
yscreen = ymouse;

Thats not velocity :( can't use all that.
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 » Thu Jun 06, 2013 12:23 am

Your posts are usually pretty confusing, and it is very hard to understand what you actually want. I've already mentioned the following as a solution, which you denied. I'll post an actual example, so I don't know if it was you not understanding me, or me not understanding you. Remembering that this solution is not specific to the canvas.
Attachments
draw.ged
(3.21 KiB) Downloaded 148 times
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 bat78 » Thu Jun 06, 2013 8:37 pm

dreign, thats drawing in canvas. I cant use canvas. I gived u game as an example what more.
Actor will have collation to the patch im drawing, thats how should the drawing be. Drawing with actor. (Particle/Factory) gE Tutorial x:
The problem is the drawing when u move the mouse fast. It become on dots. Thats all.
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 » Fri Jun 07, 2013 6:10 pm

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.
Attachments
draw.zip
(20.49 KiB) Downloaded 152 times
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 Hblade » Fri Jun 07, 2013 8:19 pm

You can have a lot of fun with that sky xD
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Next

Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest