-
Nov 13th, 2003, 05:12 PM
#1
Thread Starter
Fanatic Member
How To Make: Screen Killer (Game)
I started this thread in the C++ section, because any help would be more relevant in the context of C++.
(Keep in mind I am only moderately comfortable in GDI Api calls and that is what I will be using despite your opinions positively or negatively)
The Idea (and yes I realize there is nothing new about it and its been done, but nonetheless)
A Game that when started captures your screen, then opens a window with a smaller version of your screen. You are a shotgun on the screen, you can move your gun wherever you want in the confines of the window and fire the gun which will dispense a round from the ejection port (or whatever you call it) and then a black hole with a bunch of little holes will appear on the screen where you fired.
The Build
Program Load
Captures screen as bitmap in memory
Main window loaded
Screen capture drawn to reduced size on main window(unsure how to do this yet)
Draw the initial image of the shotgun on the center of the main window.
When the shotgun moves, redraw screen capture, then redraw shotgun in new xy position.
When shotgun fires draw blast image over screen capture relevant to the shotguns xy.
When shotgun fires display gun recoil, draw a timed series of images showing gun in various stage of recoil (is this how it should be done?)
Basically I am looking help on the items I put notes in (), and ideas on how people would do it. Remember I am using GDI, not DirectX or OpenGL.
Thanks thanks thanks!!!
-
Nov 14th, 2003, 01:24 AM
#2
Fanatic Member
Re: How To Make: Screen Killer (Game)
Originally posted by BillBoeBaggins
Screen capture drawn to reduced size on main window(unsure how to do this yet)
Use the StretchBlt API
Originally posted by BillBoeBaggins
When the shotgun moves, redraw screen capture, then redraw shotgun in new xy position.
You shouldn't redraw the entire sceen capture, only the part where you had the shotgun before you moved it.
Originally posted by BillBoeBaggins
When shotgun fires display gun recoil, draw a timed series of images showing gun in various stage of recoil (is this how it should be done?)
Yeah, that is how I would have done it (that doesn't mean that it is the right way, but it works...)
Never argue with fools, they will only drag you down to their level, and beat you with experience.
Q: How do you tell an experienced hacker from a novice?
A: The latter thinks there's 1000 bytes in a kilobyte, while the former is sure there's 1024 meters in a kilometer
-
Nov 14th, 2003, 02:41 AM
#3
transcendental analytic
create a compatible bitmap and device context, get the desktop dc with getdc(0), stretchblt it on the compatible dc and then release the desktop dc. as you need to redraw, use bitblt from the memory dc onto your main window dc.
the shotgun is prolly transparent so you need to create masks for each sample in the animation, either that or use a chroma blit funciton
Use
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Nov 14th, 2003, 12:40 PM
#4
Thread Starter
Fanatic Member
-
Nov 15th, 2003, 04:49 AM
#5
transcendental analytic
Use
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Nov 20th, 2003, 06:23 PM
#6
Thread Starter
Fanatic Member
Thanks for all your help guys!!!
It all worked out pretty good.
Kedaman, thanks to the article link I have learned a lot about Device Context's and I was able to draw my images with transparency.
McCain, also thanks to you for the StretchBlt help, it really worked extremely easy with very little hiccups.
I haven't attempted any animation for it yet.
If you want to see the results thus far....
http://www.geocities.com/yassinator/screenkill/sk.html
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
|