|
-
Jan 18th, 2003, 10:33 AM
#1
Thread Starter
Hyperactive Member
How to clear only the ship(A newbie at game programming)Plz help
Hello Every1,
I'm have just started game programming & have a small doubt. I want to make a small game just like arkanoid. I have made a procedure called DrawGameArea() which draws the border & the scoring, lives & hint area. Now to move the paddle i have to clear the screen everytime. So when drawing the paddle, i have to call the DrawGameArea() procedure also to draw the game area. Is there a way so that i have to clear only the paddle & the rest of the screen remains the same. Or any other way of doing this stuff. I'm pretty much a newbie at game programming so thought maybe some1 can help on this. Thanx in advance.
If Not VB Then Exit
------------------------------------------------
visit me @ http://mzubair.50g.com/
-
Jan 18th, 2003, 11:25 AM
#2
Are you using BitBlt or DX or what???
-
Jan 18th, 2003, 11:55 AM
#3
Frenzied Member
In general you WANT to clear the screen each frame.
Z.
-
Jan 18th, 2003, 12:05 PM
#4
But if the background don't move, you can only Blt the size of what is moving at the point it was before it moved, and then Blt the picture to where oyu want to move it. In a game with no scrooling background, this will improve speed a lot...
-
Jan 18th, 2003, 01:56 PM
#5
Only in API, not in DirectX.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jan 18th, 2003, 02:03 PM
#6
Originally posted by CornedBee
Only in API, not in DirectX.
What do you mean...not improve speed or not possible in DX???
-
Jan 18th, 2003, 02:21 PM
#7
Not improve speed - not much at least.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jan 18th, 2003, 02:24 PM
#8
I have never tested the speed improvement, but I think it is a reason for the DX SDK to have an example on how to do it, and J. Harbour to have an example in his book on how to do it....but I have not tested it so I can't tell how much inprovment....
-
Jan 18th, 2003, 03:45 PM
#9
I believe the improvement is not worth the additional work - to test which areas are invalidated and such. The whole concept is probably only usable for simple games (not any 3d games due to the techniques used) without too much extra work, and for those games the speed gain is irrelevant.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jan 18th, 2003, 03:49 PM
#10
No....not 3D games. I'm talking about 2D games with a non scrolling background. That is what it is used for....
-
Jan 19th, 2003, 11:58 AM
#11
Member
draw a balck(background color) bar where your bar was previously and draw the white one at the new place. there, so simple !
 ppl saw this
Die, ***** Die !
-
Jan 20th, 2003, 04:18 AM
#12
Originally posted by NoteMe
No....not 3D games. I'm talking about 2D games with a non scrolling background. That is what it is used for....
I'm currently writing such a game in C#. I still repaint everything everytime simply because it's easier. Such a game does not need the speed gain you have.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jan 20th, 2003, 07:48 AM
#13
Member
maybe he's doing something much more resource extensive like a physics engine or hi-fi collissions and he wants toinch every single cpu cycle.
 ppl saw this
Die, ***** Die !
-
Jan 20th, 2003, 08:20 AM
#14
Yeah, but in that kind of game you can't even place that many objects if you use a good collision algorithm.
Physics modelling doesn't take that many cycles.
AI might be an issue, yes.
But if the card supports hardware blitting (nearly all modern cards do) then you might use more CPU cycles determining what to redraw than actually redrawing everything. Hardware blitting can be in parrallel with other calculations.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jan 21st, 2003, 12:16 PM
#15
Member
true but there are physics engines that could clog your fps right to their very roots. like karma of course, in ut 2003, i get 5 fps on my 32 mb card if i use full physics details with 5 bots. aargh !!
 ppl saw this
Die, ***** Die !
-
Jan 21st, 2003, 12:24 PM
#16
Frenzied Member
And then, we ARE assuming VB here, and if you want every CPU cycle, you arent using VB 
Z.
-
Jan 21st, 2003, 09:09 PM
#17
Member
 ppl saw this
Die, ***** Die !
-
Jan 22nd, 2003, 03:21 PM
#18
Hyperactive Member
not(False)
____________________________________________
Please rate my messages. Thank you!
____________________________________________
Bram Vandenbon
http://www.bramvandenbon.com
-
Jan 22nd, 2003, 03:45 PM
#19
-
Jan 22nd, 2003, 06:30 PM
#20
Hyperactive Member
____________________________________________
Please rate my messages. Thank you!
____________________________________________
Bram Vandenbon
http://www.bramvandenbon.com
-
Jan 22nd, 2003, 06:46 PM
#21
Frenzied Member
-
Jan 23rd, 2003, 01:34 AM
#22
I have to admitt I couldn't understand the logic befind the last one, so I think the VBForums compiler got an error, and terminated this thread...
-
Jan 23rd, 2003, 01:56 AM
#23
Frenzied Member
Originally posted by NoteMe
I have to admitt I couldn't understand the logic befind the last one, so I think the VBForums compiler got an error, and terminated this thread...
What, the -4? Non-Zero == true, Zero == false.
Z.
-
Jan 23rd, 2003, 04:38 AM
#24
Hyperactive Member
Sorry for wasting the topic, people ... Let's get back to the last usefull post
____________________________________________
Please rate my messages. Thank you!
____________________________________________
Bram Vandenbon
http://www.bramvandenbon.com
-
Jan 23rd, 2003, 05:07 AM
#25
Originally posted by Zaei
And then, we ARE assuming VB here, and if you want every CPU cycle, you arent using VB 
Z.
This was the last real post. And it is true. But you can always, say that. Vb is to slow...so why not use C++...C++ is too slow, so why not use ASM, ASM is too slow, why not make a chip set from scratch.....
-
Jan 23rd, 2003, 08:54 AM
#26
Member
why not make bubble memory chambers of own, or maybe nanoelectronics (!bad)
 ppl saw this
Die, ***** Die !
-
Jan 23rd, 2003, 03:17 PM
#27
Anyway, I think the standard spectrum analyzer plugin of winamp erases only the parts of the screen that might have changed (= the wave part, the spectrum part and every second the song title part)
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jan 24th, 2003, 12:07 AM
#28
Fanatic Member
Heh, his own thread and tough coder only posted to start it.
-
Jan 24th, 2003, 03:26 AM
#29
Member
 ppl saw this
Die, ***** Die !
-
Jan 24th, 2003, 10:26 AM
#30
Thread Starter
Hyperactive Member
Hey guys, u r all off the track a bit. Cmon, help me out. Well, i'm using only BitBlt to achieve this. can u guys help...
If Not VB Then Exit
------------------------------------------------
visit me @ http://mzubair.50g.com/
-
Jan 24th, 2003, 06:50 PM
#31
Addicted Member
clear the paddle only?
what about the bouncing ball and the blocks that you have to hit?
they need to be redrawn as well...
you said you only want to clear and redraw the paddle
just a thought...
have 3 pictureboxes:
×----MAIN: will be the final output
x----BG: will contain the background HDC(so you dont redraw)
X----backbuffer: copy BG to this 1rst, then the paddle & other
things that need to be animated(ball, blocks) and after everything
is drawn here, Bitblt everything to MAIN
probably this will make it slower since you are adding extra
pictureboxes...
______
another option would be to copy the background area where you
are going to put the paddle, and store it somewhere along with
it's X and Y position where it was taken from in the picturebox...
then bitblt the paddle on that area, to erase it, just copy the
area that you had stored before and put it back to it's X & Y
position.
I dont know if I explained that last one good, or I left out anything, well, ::yawn::, feeling sleepy but not gonna go to
sleep, laters
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|