line to

Non-platform specific questions.

line to

Postby Kalladdolf » Fri Feb 22, 2008 3:21 pm

now does anybody know how to simply draw a line from one actor to another?
Since I got con-fuzzled with the canvas stuff, I can't figure it out :oops:
User avatar
Kalladdolf
 
Posts: 2427
Joined: Sat Sep 08, 2007 8:22 am
Location: Germany
Score: 120 Give a positive score

Re: line to

Postby makslane » Sat Feb 23, 2008 12:32 am

Try a code like this:

Code: Select all
int xc, yc;

//Clear the screen
erase(0, 0, 0, 0);
setpen(255, 253, 251, 0, 1);

//From actor1
xc = player.xscreen;
yc = player.yscreen;
screen_to_actor(&xc, &yc);
moveto(xc, yc);

//To actor2
xc = player2.xscreen;
yc = player2.yscreen;
screen_to_actor(&xc, &yc);
lineto(xc, yc);
Game Editor is an open source game creator software that's wants to pay it's developers to keep evolving.
If you like Game Editor, make a review!
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Re: line to

Postby Kalladdolf » Sat Feb 23, 2008 8:51 am

thank you very much,
happy birthday btw =D
User avatar
Kalladdolf
 
Posts: 2427
Joined: Sat Sep 08, 2007 8:22 am
Location: Germany
Score: 120 Give a positive score

Re: line to

Postby j2graves » Sat Feb 23, 2008 1:53 pm

you could also try using bee-ant's shadow effect. btw, did I miss Makslane's birthday? HAPPY BIRTHDAY MAKSLANE!!!!!!!!!!!
No games to my name...
User avatar
j2graves
 
Posts: 1302
Joined: Thu Aug 16, 2007 6:42 pm
Location: on the other side of infinity
Score: 19 Give a positive score

Re: line to

Postby Kalladdolf » Tue Feb 26, 2008 9:36 am

there are 2 problems with the code, unfortunately:
1st, the screen behind the canvas actor goes all black
2nd, the computer starts going slowly when I let the canvas actor have the size of the screen (and move the two connected actors)
User avatar
Kalladdolf
 
Posts: 2427
Joined: Sat Sep 08, 2007 8:22 am
Location: Germany
Score: 120 Give a positive score

Re: line to

Postby DilloDude » Tue Feb 26, 2008 10:14 am

To stop it going all black, put in some transparency when erasing:
Code: Select all
erase(0, 0, 0, 1);
Image
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score

Re: line to

Postby Kalladdolf » Tue Feb 26, 2008 11:01 am

thankz
User avatar
Kalladdolf
 
Posts: 2427
Joined: Sat Sep 08, 2007 8:22 am
Location: Germany
Score: 120 Give a positive score

Re: line to

Postby thunderios » Fri Feb 29, 2008 11:00 am

I've managed to create some sort of line. Since I'm a beginner it isn't amazing but it does what it's supposed to do. But you cant draw two lines at a time and the can only go like 1-2-3-4 not 1-2 3-4, you get me?

This is my first upload and I don't know if I've done it the right way -.-'
OK u need to place 'stip' (which means dot in Dutch) in a folder called 'data' which you have to make yourself ;) then it'll work.
Oh you need a program called Game Editor too
Attachments
line.zip
(5.16 KiB) Downloaded 112 times
thunderios
 
Posts: 87
Joined: Thu Jan 31, 2008 1:18 pm
Score: 1 Give a positive score

Re: line to

Postby Kalladdolf » Fri Feb 29, 2008 3:52 pm

after a bit of experimenting, I found it out myself.
Thanks for your willingness to help, though!
:D
User avatar
Kalladdolf
 
Posts: 2427
Joined: Sat Sep 08, 2007 8:22 am
Location: Germany
Score: 120 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron