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.

DarkBASIC Discussion / Help on a Theory in Practice - Point n Click Adventures

Author
Message
Sebastian
17
Years of Service
User Offline
Joined: 12th Aug 2007
Location: Jasper, TX
Posted: 13th Aug 2007 07:26
Here's my theory (and mindya, I am a n00b to this language, and I just bought three weeks ago):

Create a Point N Click Engine
1. Use no collision (actually no need)...
A. There are buttons to click on with the mouse
B. The character only goes on commands (ie the button that says Move")
C. When on MOVE, the buttons take on other shapes: Doors, entrances and items...

2. Events Happening
A. There will be events that will happen when clicking on a certain item or character (TALK, USE, enz.)

With this Engine, I could make an RPG with pseudo-3d sprites...
But mostly it's an adventure game engine.

Now, here's the kicker...

I need to know how to make sprites, buttons and also click detection... Is there a way I can use it through Bitmap art?

Sebastian

"Do What Thou Wilt, For The Whole Be The Law... Love is the Law, Do What Thou Wilt... There Is No Law Further Then Do What Thou Wilt..."
- A. Crowley
Insert Name Here
18
Years of Service
User Offline
Joined: 20th Mar 2007
Location: Worcester, England
Posted: 13th Aug 2007 11:30
Yes. You just use DB's 'load bitmap' and 'load image' cammands.

(N-1)/n*100<n2/n-n/2+n/4*2+100
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 13th Aug 2007 20:12 Edited at: 13th Aug 2007 20:19
Here is an example that show you can use sprites or images, and yes you can use bitmap art you just need to define an area for each object like I have done in this example:

The code isn't too great but it gives you an idea of how to do collision detection that isn't dependent on sprites (the cursor isn't a sprite).


The function takes the mouse position (px,py) and checks to see if this is inside the perimeter of the object (left,top,right,bottom), "res" is what is returned: if the mouse is inside the box the result is TRUE and res=1, if the mouse is outside the box it is FALSE and will return a 0. These are all just variable names used by the function, they are not DBC commands.

Your signature has been erased by a mod because it was rubbish.
NanoGamez guy
18
Years of Service
User Offline
Joined: 13th Jan 2007
Location: Closer than you think...
Posted: 14th Aug 2007 14:01
You could also create you own mouse as a sprite and detect whether it is touching the sprite button by using the 'sprite collision' command.
That way you could even change the mouse, say when hovering over a button.


Nothing is impossible...
No really, it is.
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 14th Aug 2007 21:12
Nano's idea is good, but because sprite collisions aren't very good for cursors either make a 1x1 pixel sprite and detect collisions on that, or use the box area function with the mouse positions like I suggested. You can still have the context-sensitive cursor but don't detect collisions with it.

Your signature has been erased by a mod because it was rubbish.

Login to post a reply

Server time is: 2025-05-30 13:32:40
Your offset time is: 2025-05-30 13:32:40