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.

2D All the way! / Trying to do something really quite simple! (I'm new)

Author
Message
Robbee101
17
Years of Service
User Offline
Joined: 28th Jun 2006
Location: England
Posted: 18th Oct 2008 19:34
Hiya Ladies and Gents,

I've browsed the forum for the answer with no avail although the reason for my not finding it is probably the specific 'Dark BASIC terms' are not the same as my non-technical ones...


I am trying to make this:-

http://video.google.com/videoplay?docid=8915541551707997698

in DarkBASIC.

I am really quite new to Dark BASIC despite what my joining date to this forum may suggest

For those who are curious, the video is from a game I was working on a while back using Multimedia Fusion; a click based tool, so don't be misled in thinking I have experience in Programming, I am new yet really trying and really enjoying learning DarkBASIC... so yea, help is very much appreciated!

Also, one other question- how do I change the point on which something rotates? AKA the hotspot?

^ if this makes little sense, then please tell me and I'll try explain better


Cheers.
Robbee101
17
Years of Service
User Offline
Joined: 28th Jun 2006
Location: England
Posted: 18th Oct 2008 19:55
The first thing I'm trying to do is make the sprite look at the mouse pointer.. I know it must be something to do with working out the position of the mouse on screen with.. something else :s
Robbee101
17
Years of Service
User Offline
Joined: 28th Jun 2006
Location: England
Posted: 18th Oct 2008 20:49
f5 f5 f5
Virtual Nomad
Moderator
18
Years of Service
Recently Online
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 19th Oct 2008 01:06
i'm not familiar with the differences between Dark Basic and Dark Basic Pro but assuming DB shares the following 2 commands:

ATANFULL for making your sprite face the current mouse location using the distance between sprite x/y and mouse x/y.

as for shifting the axis on which your sprite rotates, check the OFFSET SPRITE command.

mess with both commands; it shouldn't take long to achieve the desired effects.

good luck!

Virtual Nomad
AMD XP 1800+ (~1.6 Ghz) / 1.5 GB RAM
ATI Radeon 8700LE 128 MB / Windows XP
Robbee101
17
Years of Service
User Offline
Joined: 28th Jun 2006
Location: England
Posted: 19th Oct 2008 15:01 Edited at: 19th Oct 2008 15:03
Heya Nomad, Cheers for the help!

However.. I can't quite get my head around this, I don't quite understand how you specify the sprite on which you want to rotate..




I can see from this that it is not quite correct seeing as it will only rotate with mouseX() but regardless of that, despite the "rotate sprite 1" code being within a do loop, it only does it once
i.e. the sprite changes direction upon loading then stays in that direction.
Any ideas appreciated
BMacZero
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 19th Oct 2008 17:59
You want to use ATANFULL to get the angle between the sprite and the mouse, like this:

Robbee101
17
Years of Service
User Offline
Joined: 28th Jun 2006
Location: England
Posted: 21st Oct 2008 13:59
Hiya!

Thanks for both or your help!

Login to post a reply

Server time is: 2024-05-02 21:29:28
Your offset time is: 2024-05-02 21:29:28