Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / dbSprite: Point and move twords another

Author
Message
zapakitul
17
Years of Service
User Offline
Joined: 1st Mar 2007
Location: In my world
Posted: 20th Dec 2008 23:59
Ok its my second question today, hope i'm not bugging you guys so much. I wanted to know if i can point a sprite twords the location of another, and move it twords it. Just like i am doing with 3D Objects, like:

So anyway i can do this? My goal is, creating a main sprite in the center of the screen, and several sprites around it that go twords the main sprite. Thank you.
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 21st Dec 2008 00:38
You have:
dbRotatesprite()
dbMoveSprite()
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 21st Dec 2008 02:33
I guess you're looking for a sprite equivalent of dbPointObject:


Zuka
16
Years of Service
User Offline
Joined: 21st Apr 2008
Location: They locked me in the insane asylum.
Posted: 26th Dec 2008 09:19
IanM beat me.
Niels Henriksen
20
Years of Service
User Offline
Joined: 27th Sep 2004
Location: Behind you breathing heavely
Posted: 26th Dec 2008 12:27
That could be nice to have on next update

dbPointSprite(#,x,y)

Niels Henriksen
www.tales-of-the-realms.com
if Microsoft can sell software with bugs, so can I.
Zuka
16
Years of Service
User Offline
Joined: 21st Apr 2008
Location: They locked me in the insane asylum.
Posted: 27th Dec 2008 12:02
zapakitul
17
Years of Service
User Offline
Joined: 1st Mar 2007
Location: In my world
Posted: 27th Dec 2008 15:15
Thanks guys! Also i have another question regarding sprites:
If i want to move a sprite on the screen left right up and down, but not flipping it? Like i have a sprite image, lets say this one: ! If i use dbrotate sprite and then move it, it will move up but the sprite will be upside down. How can i move the sprite left right, up, down without having to rotate the image?
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 27th Dec 2008 16:08
Something like this will do it.

zapakitul
17
Years of Service
User Offline
Joined: 1st Mar 2007
Location: In my world
Posted: 27th Dec 2008 16:43
Yeah i figured it out a few minutes after that i should use dbSprite. Thanks matty! Btw i have only one more question guys(sorry for bugging like this). Is there anyway of using dbText above a sprite? Because i have a sprite that covers the entire screen, and i can't use dbText because dbText is behind that sprite.
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 27th Dec 2008 17:19
Try dbDrawSpritesFirst().
zapakitul
17
Years of Service
User Offline
Joined: 1st Mar 2007
Location: In my world
Posted: 27th Dec 2008 18:53 Edited at: 27th Dec 2008 18:55
Ok i noticed something a little akward when doing sprite collision. I have the following piece of code:

Now i move those psrites using W A S D and the arrows, but that code only works when my second sprites moves into the first one. Yes i changed sprite colision from 2,1 to 1,2 but it is the same thing.
What i wanted to do is check if space key is pressed and if those 2 sprites colided. If so then i want to move the second sprite 4 pixels back. If control was pressed then the first sprite should move 4 pixels back. Any ideas how to solve this problem?

Login to post a reply

Server time is: 2024-09-30 13:25:21
Your offset time is: 2024-09-30 13:25:21