line to problem, really jimmy?

Non-platform specific questions.

line to problem, really jimmy?

Postby jimmynewguy » Thu May 28, 2009 2:36 am

Wow, why can't i do a line to x, y coordinates
ie:
Code: Select all
lineto(player.x, player.y);

i set the pen so it's not that, and it will work if i say line to 10, 100 but with .x and .y it wont. That makes no sense to me whatsoever. Even if i do
Code: Select all
int x2,y2;
x2 = player.x;
y2 = player.y;
lineto(x2, y2);

it wont work. Is there some reason to this?

Sorry if i sound mad, i'm a little worked up over this :oops:
Working on a probably too ambitious project! Wild-west-adventure-RPG-shooter-thing.
User avatar
jimmynewguy
 
Posts: 1137
Joined: Sat Mar 31, 2007 6:27 pm
Score: 89 Give a positive score

Re: line to problem, really jimmy?

Postby skydereign » Thu May 28, 2009 3:35 am

It might be because of the canvas has its own xy plane... kind of. Check this, not sure what you are trying to draw with the line, so it could just be your initial... Does the line actually draw?
http://game-editor.com/forum/viewtopic.php?f=5&t=6853&start=0
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: line to problem, really jimmy?

Postby DST » Thu May 28, 2009 4:14 am

x2=abs(player.x-x); seems like it would work. Dunno about the negative xy's though,
y2=abs(player.y-y); i always just put my canvas at game center. Makes it easier.

Funny though, i was going to say more but someone called me in the middle of typing out my example, and during that time sky came in and posted ahead of me. lolol.
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: line to problem, really jimmy?

Postby Hblade » Thu May 28, 2009 4:26 am

If you'd like, I could show you another method of making the line follow the actor.
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: line to problem, really jimmy?

Postby jimmynewguy » Thu May 28, 2009 1:06 pm

lol i knew it was gonna be something obvious i didn't think of (not too obvious) thanx to all, but DST's method was the one i was looking for :D
Working on a probably too ambitious project! Wild-west-adventure-RPG-shooter-thing.
User avatar
jimmynewguy
 
Posts: 1137
Joined: Sat Mar 31, 2007 6:27 pm
Score: 89 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron