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 / "Wendigo, you are an idiot. Do it again!"

Author
Message
ShadowHarlequin
21
Years of Service
User Offline
Joined: 13th Sep 2002
Location:
Posted: 23rd Sep 2002 13:28
can u make it real simple for me
with commands that work -i dont think the last 1 did bro.
and where do i tell it to use my object?
ShadowHarlequin aka Cyclone
00taylorkirkgre@westsomerset.somerset.sch.uk
fathamster@37.com
WarWolf
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 23rd Sep 2002 21:28
Uhm... This post is a little "blurry"... Could you please specify a little better what your problem is?

I didn't steal it!
ShadowHarlequin
21
Years of Service
User Offline
Joined: 13th Sep 2002
Location:
Posted: 25th Sep 2002 13:30
make this code work with my hover.x object and the arrow keys?
`Create a Spaceship structure
Type SpaceShip
`actual x/y coords
x
y
`'sliding' x/y coords
xs
ys
`Current YAW (or yrotation)
dir
endtype

`Make ourselves a spaceship!
Andromida as Spaceship

Do
Goto Move_Player
Goto Andromida_Player_Control
Loop

`Player junk
Move_Player:

`This is updates the ships position by its thrust
Andromida.x = Andromida.x + Andromida.xs
Andromida.y = Andromida.y + Andromida.ys
Return

`Now the nitty gritty math stuff
`Grab the Input and thrust accordingly
Andromida_Player_Control:

`thrust is held in xs and ys
if upkey() = 1 then
Andromida.xs = Andromida.xs + cos(wrapvalue(Andromida.dir))
Andromida.ys = Andromida.ys - sin(wrapvalue(Andromida.dir))
endif
Return

ShadowHarlequin aka Cyclone
00taylorkirkgre@westsomerset.somerset.sch.uk
fathamster@37.com
The Darthster
21
Years of Service
User Offline
Joined: 25th Sep 2002
Location: United Kingdom
Posted: 26th Sep 2002 01:46
I didn't know you could do oop stuff in dbpro. In that code you don't appear to be able to turn the ship.
ShadowHarlequin
21
Years of Service
User Offline
Joined: 13th Sep 2002
Location:
Posted: 26th Sep 2002 13:23
yeah. so have u got code that will let me turn an object and use its thrust to go in the new direction (like a hovercraft)?

ShadowHarlequin aka Cyclone
00taylorkirkgre@westsomerset.somerset.sch.uk
fathamster@37.com
deadlyduck
21
Years of Service
User Offline
Joined: 19th Sep 2002
Location: United Kingdom
Posted: 26th Sep 2002 17:39
Do
Goto Move_Player
Goto Andromida_Player_Control
Loop

err just a thought but shouldn't these be Gosub?
The Darthster
21
Years of Service
User Offline
Joined: 25th Sep 2002
Location: United Kingdom
Posted: 26th Sep 2002 18:56
ok.



Hope that works, I made it off the top of my head.

That will load your hover object then move it about using the arrow keys. You'll need some sort of world to move it about in, and also camera control so you can see it. You might have to scale the hover.x object about before you can work with it. You can also add stuff like tilting the object when it goes round corners.
The Darthster
21
Years of Service
User Offline
Joined: 25th Sep 2002
Location: United Kingdom
Posted: 26th Sep 2002 18:59
forgot to mention you'll need a value for friction# otherwise it won't work. Something less than 1, varied on what the object is and how much friction it should have. For a hovercraft I'd say about 0.98.
The Wendigo
21
Years of Service
User Offline
Joined: 13th Sep 2002
Location: A hole near the base of a tree in the US
Posted: 27th Sep 2002 01:38
It didn't work? Sorry about that I haven't been to the forums for a while. I'll start working on one that will work really well (tested) if the Darthster's code doesn't quite do it. BTW, I'm having a VERY tough time doing 3D freeflight movement seeing as there is a glitch in the object's turn, roll, and pitch commands (ie. pitch up x,1 will actually only turn the object's mesh direction, but not the true objects direction)! But I'll work on getting you at least a 2D version until I can get the 3D stuff to work.

OOOOH!! The last line of code doesn't work because if you do an IF statement with an ENDIF, you do not use a THEN. Just erase the THEN. Before I wrote that I must have been doing some VB programming

ShadowHarlequin
21
Years of Service
User Offline
Joined: 13th Sep 2002
Location:
Posted: 27th Sep 2002 13:28
cheers guys ill try it this weekend and let u know

ShadowHarlequin aka Cyclone
00taylorkirkgre@westsomerset.somerset.sch.uk
fathamster@37.com
The Wendigo
21
Years of Service
User Offline
Joined: 13th Sep 2002
Location: A hole near the base of a tree in the US
Posted: 28th Sep 2002 09:05
I thought I posted the link here, but I guess not. Wonder where I put it? Here it is:

http://www.geocities.com/wendigosoft/Files/

Login to post a reply

Server time is: 2024-04-25 02:46:21
Your offset time is: 2024-04-25 02:46:21