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 / im new please help me

Author
Message
Milky the purple crab
19
Years of Service
User Offline
Joined: 5th Aug 2005
Location:
Posted: 11th Aug 2005 10:49
hi, im having problems with this code.
please try this code and you will see whats wrong.
whatever answer i put in all the IFTHEN things appear please help?

also if you were wondering i was going to make an object once i figured this out.

thx

I don't fear pain.....I fear feeling it.
Deep Thought 42
19
Years of Service
User Offline
Joined: 31st Jul 2005
Location: New Jersey, USA
Posted: 11th Aug 2005 14:43
You'll have to re-post it. Click the button at the top-right corner of the "Post Forum Message" box. That will begin your code snippet. Click it again to finish your snippet. The Code box below the message box doesn't work for some reason.

"Winners never quit and quitters never win. But those who never win and never quit are idiots."
Milky the purple crab
19
Years of Service
User Offline
Joined: 5th Aug 2005
Location:
Posted: 12th Aug 2005 10:35
nevermind i figured it out

thx for paying attention though

I don't fear pain.....I fear feeling it.
Milky the purple crab
19
Years of Service
User Offline
Joined: 5th Aug 2005
Location:
Posted: 12th Aug 2005 10:36
sorry i posted the wrong thing i havent figured this out yet



thx

I don't fear pain.....I fear feeling it.
Xolatron old
20
Years of Service
User Offline
Joined: 25th Jan 2004
Location: The Star Forge Language: DBpro
Posted: 12th Aug 2005 23:33 Edited at: 12th Aug 2005 23:37
OK, I'll just repost what your code should be to work. I hope you can learn what's wrong; if not just ask. (sorry don't have time to explain everything right now )



This code could be optimized be select-case statements, 'if-else's, and of course loops, but for simplicity to learn from I left it in simple 'if-then's and goto's

Well anyways, here is it optimized (don't worry about this until you can understand the first example)



-Xol

Milky the purple crab
19
Years of Service
User Offline
Joined: 5th Aug 2005
Location:
Posted: 13th Aug 2005 08:54
thx xolatron!!!!

a few questions how does DB know that what real$ is?

and what is rand?

thanks again

I don't fear pain.....I fear feeling it.
Milky the purple crab
19
Years of Service
User Offline
Joined: 5th Aug 2005
Location:
Posted: 13th Aug 2005 09:10
another problem i can't see the text when i put in the shape



this is confusing but i think im getting the hang of it

I don't fear pain.....I fear feeling it.
Dot Merix
21
Years of Service
User Offline
Joined: 15th Oct 2003
Location: Canada
Posted: 13th Aug 2005 09:18
rand is a variable holding a random number from 1 to 6... I think Xolatron meant to put rand = rnd(4)+1, which gives a random number from 1 to 5.



WindowsXP Home(Service pack 2), Athlon XP 2400+(2.1Ghz), 1GIG Ram, Ati Radeon 9800Pro 128MB.
Milky the purple crab
19
Years of Service
User Offline
Joined: 5th Aug 2005
Location:
Posted: 13th Aug 2005 09:21
cool thanks now i think i understand that now, so if it was rand=rnd(6)+1 it would be a random number from 1 to 7?

I don't fear pain.....I fear feeling it.
Dot Merix
21
Years of Service
User Offline
Joined: 15th Oct 2003
Location: Canada
Posted: 13th Aug 2005 09:22 Edited at: 13th Aug 2005 09:22
That's correct.

As for your text problem.. I'm not sure about that, i've had the same problem occur before to me aswell... i'm trying a few different ways to see if i can get it to work.



WindowsXP Home(Service pack 2), Athlon XP 2400+(2.1Ghz), 1GIG Ram, Ati Radeon 9800Pro 128MB.
Dot Merix
21
Years of Service
User Offline
Joined: 15th Oct 2003
Location: Canada
Posted: 13th Aug 2005 09:26 Edited at: 13th Aug 2005 09:27
how bout something like this...





WindowsXP Home(Service pack 2), Athlon XP 2400+(2.1Ghz), 1GIG Ram, Ati Radeon 9800Pro 128MB.
Milky the purple crab
19
Years of Service
User Offline
Joined: 5th Aug 2005
Location:
Posted: 13th Aug 2005 09:36
wow it works but the text blends in with the sphere on about the second line.

how do you change the object colour to red?

I don't fear pain.....I fear feeling it.
Dot Merix
21
Years of Service
User Offline
Joined: 15th Oct 2003
Location: Canada
Posted: 13th Aug 2005 09:39 Edited at: 13th Aug 2005 09:43
This'll make the object red.





WindowsXP Home(Service pack 2), Athlon XP 2400+(2.1Ghz), 1GIG Ram, Ati Radeon 9800Pro 128MB.
Milky the purple crab
19
Years of Service
User Offline
Joined: 5th Aug 2005
Location:
Posted: 13th Aug 2005 10:08


this line in the code snippet is a SYNTAX ERROR. UNRECOGNISED PARAMETER

I don't fear pain.....I fear feeling it.
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 13th Aug 2005 10:19
It's because Darkbasic Classic can't handle rem statements to be on the same line of code... unless you use a colon to separate the commands.

Milky the purple crab
19
Years of Service
User Offline
Joined: 5th Aug 2005
Location:
Posted: 13th Aug 2005 10:20
thx

I don't fear pain.....I fear feeling it.
Milky the purple crab
19
Years of Service
User Offline
Joined: 5th Aug 2005
Location:
Posted: 13th Aug 2005 10:22
um 1 more question. how do i make it so the screen stops flashing?

I don't fear pain.....I fear feeling it.
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 13th Aug 2005 10:37
It doesn't flash for me.
Milky the purple crab
19
Years of Service
User Offline
Joined: 5th Aug 2005
Location:
Posted: 13th Aug 2005 10:42
do you have DBP? because maybe thats why mine flashes i have DBC

I don't fear pain.....I fear feeling it.
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 13th Aug 2005 11:17 Edited at: 13th Aug 2005 11:17
I have both... now. After I bought Pro I downloaded the Classic Trial to help people that use Classic. Then I bought the Classic version from a friend of mine that told me about Darkbasic (after months of him not programming). I offered to buy it from him so I could continue to help people with Classic problems. Thank God he didn't mind selling it cheap.

It doesn't flash for me in Classic or Pro... what does your current code look like?
Dot Merix
21
Years of Service
User Offline
Joined: 15th Oct 2003
Location: Canada
Posted: 13th Aug 2005 20:53 Edited at: 13th Aug 2005 20:54
It doesnt flash for me either.

What kind of graphics card do you have, how much graphics card memory?



WindowsXP Home(Service pack 2), Athlon XP 2400+(2.1Ghz), 1GIG Ram, Ati Radeon 9800Pro 128MB.
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 13th Aug 2005 22:51
Try putting the line

CLS 0

on the very first line after Sync On. This should stop the flashing.

Also, if you are using objects like Sphere, then you should be using Sync ON - not off.

When you have a 3D view, the Sync will put the 3D screen over the top of any text, (deleting it), but you have a couple of options:

1. Put all your text and print commands immediately AFTER the Sync which updates the 3D camera view.

2. Use Set Camera View to leave a 'non-3D' area of the screen that you can print on. This area will not be affected by the Sync.

For example, Set Camera View 0,0,800,600 will make the 3D view full screen, whereas Set Camera View 0,100,800,600 will leave a 100 pixel strip running across the top of the screen for a menu that you can print on without being affected by sync. You can even create an 800x100 image in a paint program and paste it at 0,0...

Your text problem is actually down to using Input. When you use this, the program 'freezes' while something is typed in. Therefore, the text is never replaced after the last screen refresh.

You can get round this by cheating. Simply set the camera view to 0,0,1,1 and the current 3D image will be frozen on the screen while you input. After the input command, return the camera view to what it was previously.

Here's your code which I've modified a bit for you. I wasn't too sure what you were actually trying to do so I just concentrated on demonstrating how to get round your problems...



TDK_Man
Milky the purple crab
19
Years of Service
User Offline
Joined: 5th Aug 2005
Location:
Posted: 14th Aug 2005 10:50
thx tdk_man

i am having a problem loading in bitmaps i don't know how to laod them in the put LOAD BITMAP "name" but it says the file doesn't exist.

what am i doing wrong?

I don't fear pain.....I fear feeling it.
Me!
19
Years of Service
User Offline
Joined: 26th Jul 2005
Location:
Posted: 14th Aug 2005 11:14
if you have an image called

battle.bmp

then your command should read

load bitmap "battle.bmp",0

the image should be in the same folder as the program file unless you enter a path to the image, the name should be exactly the same as it is in windows, if it has a capital first letter then the filename has to etc.

Milky the purple crab
19
Years of Service
User Offline
Joined: 5th Aug 2005
Location:
Posted: 14th Aug 2005 11:59
cool thanks do you know any good free programs the can be used to make bitmaps?

I don't fear pain.....I fear feeling it.
Me!
19
Years of Service
User Offline
Joined: 26th Jul 2005
Location:
Posted: 14th Aug 2005 12:37 Edited at: 14th Aug 2005 12:38
er? MS paint, Photoimpact, Photostudio, Canvas 6, Gimp, Photoshop, Painter, Photoshop gold, project Dogwaffle, Deluxe paint or just about anything that allows you to draw pictures, either download the Demo for one of the above or just go to start/all programs/accessories/paint.

Milky the purple crab
19
Years of Service
User Offline
Joined: 5th Aug 2005
Location:
Posted: 14th Aug 2005 12:41
thanks i tried paint but its hard i want something that has a ummmm grid so i can make sure all the tiles line up

I don't fear pain.....I fear feeling it.
Me!
19
Years of Service
User Offline
Joined: 26th Jul 2005
Location:
Posted: 14th Aug 2005 15:45
in paint, go to view/zoom/custom, select 800% then go back to view/zoom and select show grid, that any better?

TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 14th Aug 2005 19:16 Edited at: 14th Aug 2005 19:18
You might be able to find an older version of PaintShop Pro around somewhere too. I'm sure earlier versions used to be free, though I might be wrong.

If you have no luck, post back here. I think I might have PSP4 or 5 in my archives and if they are free versions I can upload one for you.

Even the oldest PSP is miles better than Paint!

Quote: "load bitmap "battle.bmp",0"


You should also use Load Image - not Load Bitmap. You can only have 32 bitmaps, but you can have 65535 images loaded at the same time.

With Load Image, you can also use Paste Image X,Y to place the image on screen at the required position.

Oh yes btw, the filename isn't case sensitive. If the image on disk is MyBMP.bmp then Load Image "mybmp.bmp" will work fine.

TDK_Man
Me!
19
Years of Service
User Offline
Joined: 26th Jul 2005
Location:
Posted: 14th Aug 2005 20:33 Edited at: 14th Aug 2005 20:34
@TDK. uh! my bad, I just spent the last two days configuring Linux boxes, case does matter under Linux, I was in hybrid dos mode there for a moment

TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 14th Aug 2005 21:04 Edited at: 14th Aug 2005 21:05
Easily done!

After a break from DB for a while working on Delphi projects, in DB I was forever typing:

A := 100

And, I'm seriously considering adding a pre-processor action in my IDE which will automatically replace all the //'s in my DB code with Rem's!

TDK_Man
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 14th Aug 2005 21:37
think that 'rem','`' and '//' should all do the same thing in your IDE, it makes it better for people used to C++ and Delphi etc

"Well if she dies it'll teach her not to do it again..." - Me
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 14th Aug 2005 23:37
Quote: "thanks i tried paint but its hard i want something that has a ummmm grid so i can make sure all the tiles line up"


Paint Shop Pro has custom grids but it isn't free.

http://www.corel.com/servlet/Satellite?pagename=Corel3/Products/Display&pid=1047023911984
Kim Possible
19
Years of Service
User Offline
Joined: 13th Aug 2005
Location: Where ever there\'s trouble.
Posted: 14th Aug 2005 23:56
The GIMP is an awesome cross-platform image editor.

http://www.gimp.org
Milky the purple crab
19
Years of Service
User Offline
Joined: 5th Aug 2005
Location:
Posted: 15th Aug 2005 09:25
i'll look for one later.

how do i make it so that objects are randomly positioned? not repeatitivly just once

I don't fear pain.....I fear feeling it.
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 15th Aug 2005 15:29
Put Randomize Timer() at the start of your program. If you don't, Rnd gives you random numbers, but always in the same sequence and starting at the same number.

TDK_Man

Milky the purple crab
19
Years of Service
User Offline
Joined: 5th Aug 2005
Location:
Posted: 16th Aug 2005 09:44
can anyone please refer me to a free easy to use 2d image editor that is good at making bitmaps like pacman please

I don't fear pain.....I fear feeling it.
Me!
19
Years of Service
User Offline
Joined: 26th Jul 2005
Location:
Posted: 16th Aug 2005 18:16
Quote: "a free easy to use 2d image editor"


you already have the simplest possible, good, 2D image editor on your computer, its called Paint, they don`t come any simpler, lots of people here make excellent graphics with nothing more than Paint, I have noticed that every time you try something you change track the instant it gets the least bit hard, you can`t do anthing in programming that way, thats why people like John Carmack drive luxury Italian sports cars, because they applied a lot of work and talent to their projects and the world repaid them for their efforts, Hello World will not make you a millionaire, DoomIII will, and to make something like DoomIII takes a LOT of time and effort, if you are not willing to learn to use a simple application like Paint then about all I can suggest is something like a childrens colouring program, thats about the next thing down the list from Paint, and you can make good graphics with Paint (before you say it`s not possible), Pacman is well within the bounds of possibility for Paint.

a picture done in paint (with a bit of post blurring in photoshop)
http://www.deviantart.com/deviation/17908194/
be sure to see the full size image (it shows as a smaller image 1st)



Milky the purple crab
19
Years of Service
User Offline
Joined: 5th Aug 2005
Location:
Posted: 17th Aug 2005 01:34
wow that pic was done all in paint.
i wasn't changing track i was just trying to learn how to do things.
i found some tutorials and I am looking at them. i found darkedit too so that makes it easier

thanks for the help

I don't fear pain.....I fear feeling it.
Dot Merix
21
Years of Service
User Offline
Joined: 15th Oct 2003
Location: Canada
Posted: 17th Aug 2005 01:44
You could always try Paint.NET

http://www.eecs.wsu.edu/paint.net/download.htm



WindowsXP Home(Service pack 2), Athlon XP 2400+(2.1Ghz), 1GIG Ram, Ati Radeon 9800Pro 128MB.
Milky the purple crab
19
Years of Service
User Offline
Joined: 5th Aug 2005
Location:
Posted: 17th Aug 2005 13:08
i am making a pong game. i have learnt the basics of it, but my bats only move once and thats it.



i don't understand why? i figured pong was a easy way to learn the basic commands of DB.

I don't fear pain.....I fear feeling it.
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 18th Aug 2005 05:49
The point camera and position camera doesn't need to be in the do loop (unless you want to change it all the time). The check for the limits is off a bit... that's one thing that was preventing the paddles from moving. Position object needed the "0=" removed so that it's just p1# and p2# at the end of the position object command. I added a couple of text commands to show the positions of the paddles (for testing).

Hope this helps.

Milky the purple crab
19
Years of Service
User Offline
Joined: 5th Aug 2005
Location:
Posted: 18th Aug 2005 07:53
thanks that helped heaps
can you tell me the code that stop them from going past 5 please?

I don't fear pain.....I fear feeling it.
Milky the purple crab
19
Years of Service
User Offline
Joined: 5th Aug 2005
Location:
Posted: 18th Aug 2005 08:40 Edited at: 18th Aug 2005 08:41
never mind i figured it out thx for helping with my first problem
but how do i make the ball move?

I don't fear pain.....I fear feeling it.
Milky the purple crab
19
Years of Service
User Offline
Joined: 5th Aug 2005
Location:
Posted: 18th Aug 2005 08:45
ok i got the ball moving but the wrong way



I don't fear pain.....I fear feeling it.
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 18th Aug 2005 10:28
balla# is the angle that the ball travels at. In your code it's at zero and doesn't change. Try adding balla#=45 before the do loop.
Milky the purple crab
19
Years of Service
User Offline
Joined: 5th Aug 2005
Location:
Posted: 18th Aug 2005 10:39 Edited at: 18th Aug 2005 11:02
great thanks

I don't fear pain.....I fear feeling it.
Milky the purple crab
19
Years of Service
User Offline
Joined: 5th Aug 2005
Location:
Posted: 18th Aug 2005 12:11 Edited at: 18th Aug 2005 12:13
I have my first bug


the ball just kinda twitches can someone please help me sort it out?

I don't fear pain.....I fear feeling it.
Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 18th Aug 2005 19:24
Maybe this is what you are trying to accomplish?



the problem was here:

and i changed it in


Immunity and Annihalation makes Immunihalation...
Milky the purple crab
19
Years of Service
User Offline
Joined: 5th Aug 2005
Location:
Posted: 19th Aug 2005 09:51
thanks sven b

now i can work on some more of it

I don't fear pain.....I fear feeling it.

Login to post a reply

Server time is: 2024-11-12 03:29:57
Your offset time is: 2024-11-12 03:29:57