Results 1 to 6 of 6

Thread: How To Make: Screen Killer (Game)

  1. #1

    Thread Starter
    Fanatic Member BillBoeBaggins's Avatar
    Join Date
    Jan 2003
    Location
    in your database, dropping your tables.
    Posts
    628

    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!!!

  2. #2
    Fanatic Member McCain's Avatar
    Join Date
    Jan 2002
    Location
    Sweden/Denmark
    Posts
    802

    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

  3. #3
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    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.

  4. #4

    Thread Starter
    Fanatic Member BillBoeBaggins's Avatar
    Join Date
    Jan 2003
    Location
    in your database, dropping your tables.
    Posts
    628
    Thank you guys very much for your help, hopefully I will have this done by Monday for me to post.

    McCain:

    I figured redrawing the whole screen capture might be a bit cumbersome on performance, but it sounded like the easiest way. I guess I will just develop an algorithm to handle individual parts to screen changes. Thanks.

    I read the info on StretchBlt it almost seems like it is cheating, how it is doing the work for you.

    Kedaman:
    I was following you up to the transparent masks and chroma function. I was just going to make my images in paint or photoshop but I don't think paint supports masks, and how would I use the masks in this concept. Since I didn't find an API for Chroma Blit then I am taking it that this is a home built function, which is fine but I was just wondering if you could elaborate a little.

    Thanks much!

  5. #5
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    here's something I think will suffice:
    http://support.microsoft.com/default...NoWebContent=1
    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.

  6. #6

    Thread Starter
    Fanatic Member BillBoeBaggins's Avatar
    Join Date
    Jan 2003
    Location
    in your database, dropping your tables.
    Posts
    628
    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
  •  



Click Here to Expand Forum to Full Width