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.

Newcomers DBPro Corner / Newb question!

Author
Message
Drum
21
Years of Service
User Offline
Joined: 10th Apr 2003
Location:
Posted: 11th Apr 2003 16:01
Ok, I am new to DarkBasic and ive got PRO trial ( well havent installed it yet until im ready cause i dont want to waste my 30 days ), k.

Well ive had alot of experience from Macromedia Flash and i'm not sure if in dark basic if you can go:

bullet.x=5 .....and etc.

basicly ill be wanting to move lots of bullets so i got:

for Count=1 to BulletCount step 1
Count.x=Count.x+2
Count.y=Count.y+2
sprite Count, Count.x , Count.y , 1
next Count

OK, now ive really confused myself... basicly i'll be having lots of objects and rather than 100 bullets each using a different variable eg. Bullet1x, bullet2x, bullet3x etc. and making it all messy. They all have their nice and tidy '.x' and '.y' inside them.

And lastly is there a way to give sprites 'Instances' like 'Bullet1' rather than confusing numbers.

phew! I'm really confused.. Flash is so easy cause everything is visible, with this you have to sort everything out in your mind!

thanx in advance!
drum
Kentaree
21
Years of Service
User Offline
Joined: 5th Oct 2002
Location: Clonmel, Ireland
Posted: 11th Apr 2003 16:09
Uhm, if I understand this right, then yeah.
Use arrays:



This will make a 2d array that can contain 999x2 Values, 999 being each of the bullets, and 2 being the x and y coordinates.

Whatever I did I didn't do it!
Drum
21
Years of Service
User Offline
Joined: 10th Apr 2003
Location:
Posted: 11th Apr 2003 16:21
Hmmm thanx for the reply!

1) And when i write :
Sprite 1,x,y,1
Does this put the picture on the screen at x and y, saying ive loaded a bmp and called it 1? or do i have to paste!!!??

Thanx for your patience with me
Drum

p.s Can i write Sprite bullet1,x,y,1 ???? would this work?

Drum
21
Years of Service
User Offline
Joined: 10th Apr 2003
Location:
Posted: 12th Apr 2003 08:03
??

Megaman Zero
21
Years of Service
User Offline
Joined: 25th Jan 2003
Location: United States
Posted: 12th Apr 2003 08:34
Drum, if you install it, you can go to Help>Index & look for the command you are looking for, & it gives you an example too. Basic is almost completely different than any version of flash. I used to use Flash 5, its similar, but not the same.

Basicaly, you would want to read a tutorial on this. Load your sprite with code & the media bar. Then you can do all sorts of things with the different names & stuff. Ill get the example that comes with the Demo of Dark Basic Pro for Sprites...



And thats just one of the many sprite commands in Dark Basic Pro. Most programming languages are different than most internet programming languages. Flash 5 is the closest that I have found to a real programming language, so it shouldnt be to hard for you to learn.

Go to http://www.darkbasic.com, & click on the Create tab & look for the tutorials. The more specific section is the Online 3D Tutorials section, in the create tab.

Try to install it, & learn the different areas of the help file (first selection on the top.) You could do a lot more & learn a lot more, if you would install it. It bunches a lot of code into different colors & it can be set up to auto indent, so you can learn a lot more, if you install the demo, rather than not installing it. Sure its only 30 day, but most people can play around with it enough to see if they like it, then they either buy it, or not buy it, based on their decision.

I hope this helps,

Drum
21
Years of Service
User Offline
Joined: 10th Apr 2003
Location:
Posted: 13th Apr 2003 04:08
Thanx ,
I plan on installing it very soon

DRUm

Drum
21
Years of Service
User Offline
Joined: 10th Apr 2003
Location:
Posted: 14th Apr 2003 03:46
hey?
if i have

COUNT=1000
for COUNT to 1000
BLAH
BLAH
next COUNT

would this do all the BLAH BLAH once? or totally skip it?

cheers
DRUM

Drum
21
Years of Service
User Offline
Joined: 10th Apr 2003
Location:
Posted: 14th Apr 2003 03:49
whoops i sorta screwed that one up


for COUNT=1000 to 1000
BLAH
BLAH
next COUNT

Whisper Wind
21
Years of Service
User Offline
Joined: 5th Apr 2003
Location:
Posted: 14th Apr 2003 04:26
It would do all the BLAH BLAH once. First it sees that COUNT is 1000 and goes and does BLAH BLAH. Then, on "next COUNT", it tries to set COUNT one higher, but notices that COUNT has already reached the maximum value and stops. Hope that helps.
Drum
21
Years of Service
User Offline
Joined: 10th Apr 2003
Location:
Posted: 14th Apr 2003 06:42
thanx mate!

DRUM

Drum
21
Years of Service
User Offline
Joined: 10th Apr 2003
Location:
Posted: 14th Apr 2003 07:27 Edited at: 14th Apr 2003 07:28
hey guys, thanx for all your help!

I've been working on some code (my first code ever in dark Basic) and its pretty basic, can you run it (lol, this is sad, cause i don't have dark at the moment) and tell me what you see. Thats if it workx!
OK, i know im asking alot of you guys, so
(whoops didnt work, ill try agian)



THANX
Drum

just a ji
21
Years of Service
User Offline
Joined: 13th Apr 2003
Location:
Posted: 14th Apr 2003 10:48
SYNTAX
Return Float=ATAN(Value)

you're getting an error because this atan() function only takes one value..

there are 10 kinds of people.. those who understand binary logic, and those who don't.
Drum
21
Years of Service
User Offline
Joined: 10th Apr 2003
Location:
Posted: 14th Apr 2003 11:54 Edited at: 14th Apr 2003 11:56
O damn....
does anyone know how to fix this???

In my flash file which i based this code from, they have

MATH.Atan2( , )

Is there anything similar in dark basic or PRO or is there a way to do this using two atan's????

arrrghhh.... i was so excited!

thanx
DRUM

Drum
21
Years of Service
User Offline
Joined: 10th Apr 2003
Location:
Posted: 14th Apr 2003 12:05 Edited at: 14th Apr 2003 12:06
Ok i Think i got it now:
I had to change Atan to Atanfull

cmon cmon cmon, plz work

(edit, forgot to put the code in)



thanx people
DRUM

just a ji
21
Years of Service
User Offline
Joined: 13th Apr 2003
Location:
Posted: 14th Apr 2003 13:00
not sure what your desired effect was, so i'm not sure if it worked or not.. at first, the code runs down to the function and exits(???)... then i moved the func to the end of the code and it drew the box... then moved it left or right, then on space another box (top-left) appeared and went away on release... hope this helps..

there are 10 kinds of people.. those who understand binary logic, and those who don't.
Drum
21
Years of Service
User Offline
Joined: 10th Apr 2003
Location:
Posted: 14th Apr 2003 14:33
mmmm... thats obviously screwed up, but thanx anywayz.

are the functions meant to be at the end?

Drum
21
Years of Service
User Offline
Joined: 10th Apr 2003
Location:
Posted: 14th Apr 2003 16:55
OK OK!

im almost absolutely sure this will work, i just picked up a few bugs... if this one dont work ill stop asking you guys (unless you willing to help me) K im an idiot

here i go:



This baby should show a large box. Move him left and right. Now move ya mouse up at a certain angle. Hit space. it should shoot a 5 pixel box up at the angle of the mouse That is all!!!!!

just a ji
21
Years of Service
User Offline
Joined: 13th Apr 2003
Location:
Posted: 14th Apr 2003 20:55
it looks like you function does need to be at the end, and after i move it there, it's compiling and running fine. so your syntax is good, but on 'space', i'm getting an error from your do:loop saying "Sprite number must be greater than zero"

there are 10 kinds of people.. those who understand binary logic, and those who don't.
matt rochon
21
Years of Service
User Offline
Joined: 15th Mar 2003
Location: Canada
Posted: 14th Apr 2003 21:26
i had the same thing, send BulletCount as a parameter to the function
and it works
Drum
21
Years of Service
User Offline
Joined: 10th Apr 2003
Location:
Posted: 15th Apr 2003 03:17
Thanx everyone!!!
DRUM

Login to post a reply

Server time is: 2024-09-20 06:33:50
Your offset time is: 2024-09-20 06:33:50