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 Professional Discussion / Help basic door code

Author
Message
Death_fox
14
Years of Service
User Offline
Joined: 18th Apr 2012
Location:
Posted: 18th Apr 2012 21:15
hi, i'm creating a simple game in the same style as the huge dungeon tutorial. anyway, i'm trying to get to get the doors working and i got them working somewhat but they are still being very glitchy, by glitchy i mean, for example, they seem to open and close depending on how close you are to them. heres the code:



state_value tells it to be open or closed, 1 for open, 0 for closed
last_block was the block that was last block to have its block type and location calculated, "#" means a wall
Daniel wright 2311
User Banned
Posted: 19th Apr 2012 00:57
This is what I do,first,I use animated doors with frame numbers,Then all I do is something like this after they all are positioned and loaded into place.

if object collition(player,door)=1 and enterkey()=1
play object door,0,15
end if

its that easy trully.

my signature keeps being erased by a mod So this is my new signature.
Death_fox
14
Years of Service
User Offline
Joined: 18th Apr 2012
Location:
Posted: 19th Apr 2012 15:27
sorry, i'm still very new to darkbasic, could you tell me how you create animated object or point me to a tutorial
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 21st Apr 2012 18:08
Quote: "by glitchy i mean, for example, they seem to open and close depending on how close you are to them"


That sounds like the way they were designed in that tutorial. Not "glitchy" just not what you want perhaps?

How do you want to operate them? We can only guess how you would like it done. For example, do you want to press a certain key, do you want the doors to slide up/down or from side to side, do you want them to rotate on a hinge, etc, etc?
Death_fox
14
Years of Service
User Offline
Joined: 18th Apr 2012
Location:
Posted: 21st Apr 2012 20:29
i just want a simple door that is opened by click on it with the left mouse button and i want it to work like its on an hinge.
Daniel wright 2311
User Banned
Posted: 21st Apr 2012 23:16
Fps creator has animated doors to choose from,just download the free version,then you will have doors my friend.

my signature keeps being erased by a mod So this is my new signature.
Death_fox
14
Years of Service
User Offline
Joined: 18th Apr 2012
Location:
Posted: 24th Apr 2012 23:51
found out what was wrong with my doors, i was using the rotate command instead of the Yrotate command and that was causing my doors to basically spin 90* ever frame.

Login to post a reply

Server time is: 2026-07-10 11:51:36
Your offset time is: 2026-07-10 11:51:36