how to do drawing functions with an actor not a mouse.

You must understand the Game Editor concepts, before post here.

how to do drawing functions with an actor not a mouse.

Postby avagp » Mon May 25, 2009 4:01 am

How i can make this?:
i want my actor to be followed by a line of the drawing functions.
in my game the mouse is not used.

I have tried a lot, but i can´t.
someone help me with this. :cry:
avagp
 
Posts: 10
Joined: Fri Mar 06, 2009 12:47 pm
Score: 0 Give a positive score

Re: how to do drawing functions with an actor not a mouse.

Postby skydereign » Mon May 25, 2009 4:32 am

Well, the canvas needs variables in which to draw. So, you feed the canvas the actors xy. Your problem might be that the xy seems different. I think that canvas uses its own, so you would need to either position the canvas absolute to the real xy, ie. the origin, or find the difference from the origin. Another idea is that you just use the actual xy in accordance to the draw... Just to make sure I get what you are asking, you want a line drawn from a canvas to follow an actor. The following would be achieved by erase and draw. The following is just variable manipulation. I could make a demo if you want.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: how to do drawing functions with an actor not a mouse.

Postby avagp » Tue May 26, 2009 5:05 am

Exactly, what i was trying to do was to make a line, drawn from a canvas, to follow an actor that I move.
You got the point, i cant get the exact coordinates.
I´m confused.



Thank you for your reply, and i will be grateful if you make a demo for me, that will dissipate all my doubts (i think :D ).
In advance i give you a point for your comprehension and worry. :mrgreen:
avagp
 
Posts: 10
Joined: Fri Mar 06, 2009 12:47 pm
Score: 0 Give a positive score

Re: how to do drawing functions with an actor not a mouse.

Postby skydereign » Thu May 28, 2009 1:47 am

This shows how I got the coordinates, and also drawing a line. Not sure if it is the same movement, but if you need any more help, feel free to ask.
Attachments
linefollow.zip
(1.45 KiB) Downloaded 230 times
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: how to do drawing functions with an actor not a mouse.

Postby avagp » Thu May 28, 2009 4:59 pm

Your demo helped me a lot. (in fact i used it to do this) :) , but I thought something more like this.

The thing is, i have an actor that is followed by the view, also i have another actor with the same commands (i mean the drawing functions). Until here i´m done.
However, i would like this "draws" (lines, whatever), to paint the background (in the demo i used the actor base as a background) like actor3 in the demo, but i don't want to use an animation to draw, because the game gets slow after a while.

One last question: my game is up to 4 players and it has a problem, when i try to play with 4 people, sometimes the keys does not respond, i belive because the total of the pressed buttons.
¿there is a way to fix this, is my keyboard the problem, or making a 4 player game is completely absurd?
Attachments
drawing actor.rar
(2.16 KiB) Downloaded 175 times
avagp
 
Posts: 10
Joined: Fri Mar 06, 2009 12:47 pm
Score: 0 Give a positive score

Re: how to do drawing functions with an actor not a mouse.

Postby skydereign » Thu May 28, 2009 11:11 pm

Yeah, certain keyboards will allow more keydown events... It is not gameEditor if that is what you are thinking.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: how to do drawing functions with an actor not a mouse.

Postby avagp » Mon Jun 01, 2009 6:07 pm

I managed making an actor to paint the background, using the "draw form" function.
But yet i can not set 2 pens in the same canvas actor. It´s possible?

Or maybe there is a way that seems that you are having 2 pens to draw. Like, if you juxtapose 2 canvas actor, slightly tranparents.

Skyderiegn, you have ay ideas to do that, or someone who knows how??
avagp
 
Posts: 10
Joined: Fri Mar 06, 2009 12:47 pm
Score: 0 Give a positive score

Re: how to do drawing functions with an actor not a mouse.

Postby skydereign » Mon Jun 01, 2009 10:18 pm

The only way I can think of right now is to have variables to act as different pens. You can setpen anytime you like, so if you draw something, line a, then in the same script you can draw line b with a different pen. The only problem would be placement, but you can just hold that with variables.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: how to do drawing functions with an actor not a mouse.

Postby avagp » Tue Jun 02, 2009 3:10 pm

Ok, this is what i understood: i can change colors for the pen, so that would seem to be 2 different pens.

You said i can setpen anytime i like, but that includes more than one pen at the same time and at the same canvas actor?
Because that is my complication.

This will be my game, in synthesis (maybe this will help, i do not know):

I have 2 or more players moving on a stage, and each player has a color. When one player moves(it moves like a super smash bros player: jumping, dodging, walking, running, back and forth through the stage), it leaves a line exactly where it passed, with it's respective color (like a stele).
Also, the camera follows one of the players.
And all at the same time.


Well... that is it. :D
avagp
 
Posts: 10
Joined: Fri Mar 06, 2009 12:47 pm
Score: 0 Give a positive score

Re: how to do drawing functions with an actor not a mouse.

Postby skydereign » Tue Jun 02, 2009 11:39 pm

Well, not exactly sure how you are drawing it, but if you have multiple draws within a single script you would draw the first, reset the pen and draw the next. The thing is that you are going to draw something, it seems you want two different things drawn on canvas from one event, if so that would work, if not just add a setpen specific to the event. The events are done separately, so as long as you have the setpen at the beginning of the scripts, it will be fine.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: how to do drawing functions with an actor not a mouse.

Postby wizfit » Wed Jun 24, 2009 1:31 am

I'm trying to do something similar to the original poster. Mainly I want a line to be drawn that can activate a collision event behind an actor, but I'd like it to be drawn along the path it's traveling.

If that's not possible I want to be able to draw a spiral that has the collision event.

Thanks
wizfit
 
Posts: 3
Joined: Wed Jun 24, 2009 1:28 am
Score: 0 Give a positive score

Re: how to do drawing functions with an actor not a mouse.

Postby skydereign » Wed Jun 24, 2009 2:44 am

The collision itself will not be triggered by canvas. You can do a pixel check, but really, you can't do it cleanly. You could use an outside actor, and just use canvas to draw it, that way the pixel check would be easier. I don't think collisions, built in ones, will work at all, because you are no longer dealing with set actors, but if you were to use DrawActor, then it would not really be drawing a spiral, and still actor based.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: how to do drawing functions with an actor not a mouse.

Postby DST » Wed Jun 24, 2009 4:26 am

Sure they will. Just add a collision>any side>canvas actor.

It will collide with any part of the canvas that is holding pixels.
It's easier to be clever than it is to be kind.
http://www.lostsynapse.com
http://www.dstgames.com
User avatar
DST
 
Posts: 1117
Joined: Sun Apr 15, 2007 5:36 pm
Location: 20 minutes into the future
Score: 151 Give a positive score

Re: how to do drawing functions with an actor not a mouse.

Postby skydereign » Wed Jun 24, 2009 4:41 am

Cool, did not know that. I guess that would make sense, in that case it would be the same as the previous method, but add the collision.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: how to do drawing functions with an actor not a mouse.

Postby wizfit » Wed Jun 24, 2009 9:58 pm

Thanks for the fast responses!

I know it'll work now, but unfortunately I'm very new to GE and I'm unsure of how to draw a spiral. Another key component of this is that I need to be able to control the speed that the spiral is drawn. Is it possible to do that with the draw function?

What I'm trying to do is create a snake that spirals out from a center point, the body created behind the head as it moves.

thanks for the help
Attachments
snakespiral1.JPG
snakespiral1.JPG (2.82 KiB) Viewed 3739 times
snakespiral2.JPG
snakespiral2.JPG (1.96 KiB) Viewed 3739 times
snakespiral3.JPG
snakespiral3.JPG (3.41 KiB) Viewed 3739 times
wizfit
 
Posts: 3
Joined: Wed Jun 24, 2009 1:28 am
Score: 0 Give a positive score


Return to Advanced Topics

Who is online

Users browsing this forum: No registered users and 1 guest

cron