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 / Dam problems!!

Author
Message
Ad87am
19
Years of Service
User Offline
Joined: 4th Aug 2005
Location: England / London
Posted: 18th Aug 2005 00:44
I have a problem. I am making a side scrolling game were you fly a jet fighter and shoot stuff down. The problem I am having is that I need to make the images of the jet fighter in Photoshop, which then means when it is saved to a BMP, JPG ect.. I then have a background around the picture, which i would like to be Seethrough, in other words i have a jet fighter with a big white block around it flying throught the nice blue sky. I cant make the backgorund of that blue too becasue the levels background changes. I cant think what to do! Any one have any ideas?

http://www.Bevansfunbox.com
master programmer
19
Years of Service
User Offline
Joined: 30th May 2005
Location: 3D Space
Posted: 18th Aug 2005 00:53
I take it the white block is the area around the plane made in Photoshop, eh? Well, in that case I would change that white space to black (and it must be 0,0,0 black). Then I would use the transparency thing and set it to take off black. I'm not so good using 2D, because I usually make games in 3D. If this game is a 3D sidescroller, then use the set object OBJECT NUMBER,1,0,0 command.

Ad87am
19
Years of Service
User Offline
Joined: 4th Aug 2005
Location: England / London
Posted: 18th Aug 2005 01:16
Oh thank you, you are a life saver!!!

http://www.Bevansfunbox.com
Xolatron old
20
Years of Service
User Offline
Joined: 25th Jan 2004
Location: The Star Forge Language: DBpro
Posted: 18th Aug 2005 01:52
Please don't swear in your posts, especially the titles. (After reading this post, I am certain Ad87am was not referring to beavers)

-Xol

Ad87am
19
Years of Service
User Offline
Joined: 4th Aug 2005
Location: England / London
Posted: 18th Aug 2005 02:02
Sry, didnt know that word was offencive. Can anyone explane sprites, i have read thru some posts and im a bit confused, I aint done sprites yet

http://www.Bevansfunbox.com
waffle
22
Years of Service
User Offline
Joined: 9th Sep 2002
Location: Western USA
Posted: 18th Aug 2005 02:50
a sprite is a 2D image that is managed by DB for rendering.
Can you state exactly which part you don't understand?

sprites, images, plains, bitmaps may look simular, but they are different. The difference lies in how resourses are used.

images use the least resources, and have the most uses.
An image can be rendered to a sprite,plain. Sometimes to a bitmap,
but that gets tricky.

sprites are managed by DB to be rendered in a specific order. The same order as created. Thats how some sprites can move behind other sprites. Also, sprites are only 2D objects and DB perfoms redering in a slow method.

Plains are 2D objects but are rendered by directx as a 3D object.
Cameron
19
Years of Service
User Offline
Joined: 7th Aug 2005
Location: In Your Closet...
Posted: 18th Aug 2005 03:21 Edited at: 18th Aug 2005 03:22
Quote: "After reading this post, I am certain Ad87am was not referring to beavers)"


Hahahhaha xol u crack me up.


"Computers Are Not Smart. They Just Do What You Tell Them To."
Ad87am
19
Years of Service
User Offline
Joined: 4th Aug 2005
Location: England / London
Posted: 18th Aug 2005 09:25
I am at the stage were i have to make the playre for my game. It will be a jet fighter, but I think i have to make it a sprite. I have got a bitmap of it, with a black background so I can use the transparency thingy, also i would like to make it so when the down key is pressed, the image changes and when to up key is pressed the image changes again. I already have these images as bitmaps, so i am just trying to make it so when i move around, the jet fighter looks different.

http://www.Bevansfunbox.com
Xolatron old
20
Years of Service
User Offline
Joined: 25th Jan 2004
Location: The Star Forge Language: DBpro
Posted: 18th Aug 2005 21:03
Sprite frames:

Put all the images into one bitmap and specify how many rows and columns are in that image in the across and down parameters.
Then use the 'sprite' command.

I had some neat 2D games like this, but I think they were lost when that programming software was uninstalled .

-Xol

Ad87am
19
Years of Service
User Offline
Joined: 4th Aug 2005
Location: England / London
Posted: 18th Aug 2005 21:10
Do you mean make an image of the plane that is normal, another that is going up, and one that is going down, pt them all together in a bitmap under each other, then how do i know how many coloums and rows there are? Is there not a way to rotate the image, all i am gonna use is up and down, so it looks like it is pitching up when i press up and down when im pressing down, oh and also i want to make it so that flames come out the back when foward is pressed, i have no idea how to do that.

http://www.Bevansfunbox.com
Ad87am
19
Years of Service
User Offline
Joined: 4th Aug 2005
Location: England / London
Posted: 18th Aug 2005 21:28
Ok, i have seemed to make the sprite rotate, if i press up it rotates so it is pitching up and for down it goes down. The problem i am having now is a canot think of a code were if the up key is released, it goes back to normal, i dont want it so you press up, it pitches up and just stays at that image, i want it to level out. Here is my code, can anyone help?



I need something in after the rotate sprite and before the moveY variable.

http://www.Bevansfunbox.com
Ad87am
19
Years of Service
User Offline
Joined: 4th Aug 2005
Location: England / London
Posted: 18th Aug 2005 21:33
Oh and one more thing i forgot to mention, is there a way to make it smoothly rotate up and down? It is a big jerky when you press up and down.

http://www.Bevansfunbox.com
Xolatron old
20
Years of Service
User Offline
Joined: 25th Jan 2004
Location: The Star Forge Language: DBpro
Posted: 18th Aug 2005 22:11
you would have to have a variable for the images rotation, and another for what it's supposed to be. Have the left+right arrowkeys (or whatever you want) change the 'supposed to be' variable, then get the actual rotation variable using:


-Xol

Ad87am
19
Years of Service
User Offline
Joined: 4th Aug 2005
Location: England / London
Posted: 18th Aug 2005 22:32
I am confused, what do you mean by the supposed to be. Do i make a variable for when the key is pressed it will rotate +15, and then another one that is -15?

http://www.Bevansfunbox.com
waffle
22
Years of Service
User Offline
Joined: 9th Sep 2002
Location: Western USA
Posted: 19th Aug 2005 05:13
ok,
all you really are asking for is how to change the sprite image.
That's easy. Just call the sprite command, but with a different image. IF you want the rotation smoother, you'll need more images,
and just change them more often.

That's the simplest way.
Ad87am
19
Years of Service
User Offline
Joined: 4th Aug 2005
Location: England / London
Posted: 19th Aug 2005 18:26
I can get it to change the image by rotating it, but how do you make it rotate more then one when the key is pressed? and also i need it to go back to the normal view when the key is released. I dont know how to code that

http://www.Bevansfunbox.com
master programmer
19
Years of Service
User Offline
Joined: 30th May 2005
Location: 3D Space
Posted: 20th Aug 2005 22:40 Edited at: 20th Aug 2005 22:43
Well, I'm not so good with 2D like I said, but you could use object plains to do 2D as well. Here is a code I whipped up that may help you:

You can change the turn object commands to a command that rotates a sprite, which, to make a sprite you use this command (which I THINK I know off the top of my head) load image "IMAGE.jpg",1 : sprite 1,1,X,Y. (I think that is it, you may want to check before trusting me with that)

If you don't want to use the 3D plains, you can always just change my code and use the sprite command and rotate it instead of using my code.

My code isn't really tested, because, I've never done anything like what you're doing, so, I'm kind of just guessing here, but, I think my code should work.

Ad87am
19
Years of Service
User Offline
Joined: 4th Aug 2005
Location: England / London
Posted: 20th Aug 2005 22:57
Ahaa! never thought of the "if up key=0" which means if the up key is released right??? I think i can do it now. Any1 got any info on making 3D stuff? I just got 3d Studio Max 7 and will be making stuff on it now.

http://www.Bevansfunbox.com

Login to post a reply

Server time is: 2024-09-24 03:20:22
Your offset time is: 2024-09-24 03:20:22