Results 1 to 36 of 36

Thread: Wormipede and source(vb6, dx7, English)

  1. #1

    Thread Starter
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,628

    Cool Wormipede and source(vb6, dx7, English)

    This demo shows how to do a couple of things:
    Initialize and run Directx, And resize a window during game play. It uses directsound as well.

    Special features include similar creatures to the original centipede game including the flea and spider. My own addition is spider webs. You won't see any of this on level one, but hang tight. The difficulty increases exponentially for each level.
    The spider becomes VERY dangerous at higher levels.

    Ignore Everything before post 32. It was a trial-and-error bug-fix extravaganza. The zip is now in a different thread.


    Here's an updated link to the submission:
    http://www.vbforums.com/showthread.php?t=498393
    I am not claiming any rights to this code. Feel free to expand on it.
    Last edited by Lord Orwell; Feb 21st, 2011 at 01:42 AM. Reason: made OP a link to the other thread
    My light show youtube page (it's made the news) www.youtube.com/@lightsofelberfeld
    Contact me on the socials www.facebook.com/lordorwell

  2. #2

    Thread Starter
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,628

    Re: Wormipede and source(vb6, dx7, English)

    I just did some testing of my own, and It turns out that the top speed at higher levels (around level 3 or so) is greatly affected by your graphics card. If anyone wants to know why the grid is so big, the speed at higher levels will explain it to you. but feel free to take this code and run with it. I had originally planned to add other Centipede things to it like the flea that dropped mushrooms. I just got lazy thats all. (actually the real reason is i switched to vb.net)
    My light show youtube page (it's made the news) www.youtube.com/@lightsofelberfeld
    Contact me on the socials www.facebook.com/lordorwell

  3. #3
    Hyperactive Member singularis's Avatar
    Join Date
    Nov 2006
    Location
    Over There!
    Posts
    372

    Re: Wormipede and source(vb6, dx7, English)

    I am impressed by the smoothness but I can tell you included your own, 'programmer art'

    Please, Please, Please, Please do not allow the player to go back on themselvles and kill themselves instantly. E.g pressing left when the player is facing right
    If what I said was helpful, give me rep!

    My Complete Games: -- 2D Zone (Space Shooter game) || _2D Zone 2_ || Ninja Blob (2D platformer) || Dren (Co-op up to 4 player base defence game)

    My Projects: -- The Dread Engine (2D VB game Engine) || A* Path Finding


    An excellent site for learning DirectX7, 8 & 9 (for VB6, C# & VB.net) would be: directx4vb.vbgamer.com --- For my projects and games see: pieper.freehostia.com

  4. #4

    Thread Starter
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,628

    Re: Wormipede and source(vb6, dx7, English)

    hmm i thought i had code in there to prevent that. Must have lost it during a random lock up. I had a vb6 add-in raising hell with vb. I did the graphics with Photoshop 7, except the game over message, which is simply wordart from msword.
    My light show youtube page (it's made the news) www.youtube.com/@lightsofelberfeld
    Contact me on the socials www.facebook.com/lordorwell

  5. #5

    Thread Starter
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,628

    Re: Wormipede and source(vb6, dx7, English)

    ok here's an update that fixes the issue you mentioned. You can't kill yourself by going in reverse any more. Note that this game is skinnable and you can plug in any sounds you like too. Just replace the appropriate files.
    [Edit: Link to latest version is in post 32]
    Last edited by Lord Orwell; Apr 12th, 2008 at 01:12 AM. Reason: Removed outdated version. newer version in final post.
    My light show youtube page (it's made the news) www.youtube.com/@lightsofelberfeld
    Contact me on the socials www.facebook.com/lordorwell

  6. #6
    Junior Member
    Join Date
    Apr 2007
    Location
    Singapore
    Posts
    22

    Re: Wormipede and source(vb6, dx7, English)

    My arrow keys lag... Gotta spam it a few times to get it in the right direction...

  7. #7
    Frenzied Member zynder's Avatar
    Join Date
    Nov 2006
    Location
    localhost
    Posts
    1,434

    Re: Wormipede and source(vb6, dx7, English)

    Nice effort there. But i wonder why the game doesnt quit when i press the quit button. It should prompt a message box saying "Quit playing games? y/n"

    Is it a bug?

    ok later on i found out bug #2.

    Run the application (not on VB IDE), then minimize it. After a minute click the game or maximize it and it will throw an error saying "Error starting direct Input, please make sure you have directx installed".

    Last edited by zynder; Jun 25th, 2007 at 10:25 AM. Reason: Found a bug.

  8. #8

    Thread Starter
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,628

    Re: Wormipede and source(vb6, dx7, English)

    I get that too. Its an issue with directx evidently in xp because i used code directly out of the sdk for the directinput. I also noticed the program is a process hog. If anyone has any suggestions by looking at the code to lower processor usage, i would love to hear it. This may be why you are having keyboard lag.
    My light show youtube page (it's made the news) www.youtube.com/@lightsofelberfeld
    Contact me on the socials www.facebook.com/lordorwell

  9. #9
    Frenzied Member zynder's Avatar
    Join Date
    Nov 2006
    Location
    localhost
    Posts
    1,434

    Re: Wormipede and source(vb6, dx7, English)

    Maybe it's throwing an error because the form is minimized. Don't you think? I think you must add a condition where not to start activating directx input while the form is minimized sort of putting into freeze state.

  10. #10

    Thread Starter
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,628

    Re: Wormipede and source(vb6, dx7, English)

    i don't know. and it always does three of them. Really odd considering i only have one message box. Have to look into it one of these days.
    My light show youtube page (it's made the news) www.youtube.com/@lightsofelberfeld
    Contact me on the socials www.facebook.com/lordorwell

  11. #11
    Hyperactive Member singularis's Avatar
    Join Date
    Nov 2006
    Location
    Over There!
    Posts
    372

    Re: Wormipede and source(vb6, dx7, English)

    Tsch Tsch Tsch Mr Orwell. Its the timer that is causing the keyboard lag!

    Get rid of it at once and implement a game loop
    If what I said was helpful, give me rep!

    My Complete Games: -- 2D Zone (Space Shooter game) || _2D Zone 2_ || Ninja Blob (2D platformer) || Dren (Co-op up to 4 player base defence game)

    My Projects: -- The Dread Engine (2D VB game Engine) || A* Path Finding


    An excellent site for learning DirectX7, 8 & 9 (for VB6, C# & VB.net) would be: directx4vb.vbgamer.com --- For my projects and games see: pieper.freehostia.com

  12. #12

    Thread Starter
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,628

    Re: Wormipede and source(vb6, dx7, English)

    blah. I have a game loop. The keyboard input just isn't in it, that's all. I didn't see the need to poll the keyboard that often. If anyone wants to experiment with it, that's why the code is there. It doesn't lag at all on my system, but my computer's not a slow model either Anyone having input problems, what are you running?
    My light show youtube page (it's made the news) www.youtube.com/@lightsofelberfeld
    Contact me on the socials www.facebook.com/lordorwell

  13. #13
    Hyperactive Member singularis's Avatar
    Join Date
    Nov 2006
    Location
    Over There!
    Posts
    372

    Re: Wormipede and source(vb6, dx7, English)

    You have a loop inside a timer? Are you insane?
    If what I said was helpful, give me rep!

    My Complete Games: -- 2D Zone (Space Shooter game) || _2D Zone 2_ || Ninja Blob (2D platformer) || Dren (Co-op up to 4 player base defence game)

    My Projects: -- The Dread Engine (2D VB game Engine) || A* Path Finding


    An excellent site for learning DirectX7, 8 & 9 (for VB6, C# & VB.net) would be: directx4vb.vbgamer.com --- For my projects and games see: pieper.freehostia.com

  14. #14
    Frenzied Member zynder's Avatar
    Join Date
    Nov 2006
    Location
    localhost
    Posts
    1,434

    Re: Wormipede and source(vb6, dx7, English)

    It doesn't lag at my system though. well, there are still room for improvements.

  15. #15

    Thread Starter
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,628

    Re: Wormipede and source(vb6, dx7, English)

    no i DON'T have a loop inside a timer. you will notice the very first line of that timer disables the timer.
    My light show youtube page (it's made the news) www.youtube.com/@lightsofelberfeld
    Contact me on the socials www.facebook.com/lordorwell

  16. #16
    Hyperactive Member singularis's Avatar
    Join Date
    Nov 2006
    Location
    Over There!
    Posts
    372

    Re: Wormipede and source(vb6, dx7, English)

    Yes you do, You sly dog....
    If what I said was helpful, give me rep!

    My Complete Games: -- 2D Zone (Space Shooter game) || _2D Zone 2_ || Ninja Blob (2D platformer) || Dren (Co-op up to 4 player base defence game)

    My Projects: -- The Dread Engine (2D VB game Engine) || A* Path Finding


    An excellent site for learning DirectX7, 8 & 9 (for VB6, C# & VB.net) would be: directx4vb.vbgamer.com --- For my projects and games see: pieper.freehostia.com

  17. #17

    Thread Starter
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,628

    Re: Wormipede and source(vb6, dx7, English)

    the code has two timers on it, just because. The purpose of one of them is merely to update the screen, because when i had it inside the main game loop it was bogging down my system, and i have what was at the time of my making this game a top of the line system (i built myself).
    Here's something DIRECTLY from my code:
    Code:
    Private Sub GameTimer_Timer()
    Dim cl As Long
    Dim stored
    Dim zz As Long, yy As Long
    GameTimer.Enabled = False
    notice anything odd? The timer will only fire one time. I did this so the program could do things at the same time. I in fact got the idea straight from a code sample in the directx7 sdk, which does some really insane stuff with timers. One will enable the other and disable itself, then the other will do the same thing.
    My light show youtube page (it's made the news) www.youtube.com/@lightsofelberfeld
    Contact me on the socials www.facebook.com/lordorwell

  18. #18
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246

    Re: Wormipede and source(vb6, dx7, English)

    I saw a tutorial once that checked the state of the window on Form_Resize(), and if it was minimized it shut down DirectInput/DirectX, and on maximizing it again it reloaded it all.

    chem

    Visual Studio 6, Visual Studio.NET 2005, MASM

  19. #19

    Thread Starter
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,628

    Re: Wormipede and source(vb6, dx7, English)

    you only need to do that if you are running a Legitimate full-screen app in Exclusive Mode, which i am not. If you don't do that in exclusive-mode dx apps, they will crash when you restore the window, because they lost all video memory when the application lost focus. I cheated and i am running the app in windowed mode, even when maximized.
    My light show youtube page (it's made the news) www.youtube.com/@lightsofelberfeld
    Contact me on the socials www.facebook.com/lordorwell

  20. #20
    Hyperactive Member singularis's Avatar
    Join Date
    Nov 2006
    Location
    Over There!
    Posts
    372

    Re: Wormipede and source(vb6, dx7, English)

    @Lord_Orwell: I meant yes you do.... you sly dog e.g. your timer only fires once. What I said came out wrong
    If what I said was helpful, give me rep!

    My Complete Games: -- 2D Zone (Space Shooter game) || _2D Zone 2_ || Ninja Blob (2D platformer) || Dren (Co-op up to 4 player base defence game)

    My Projects: -- The Dread Engine (2D VB game Engine) || A* Path Finding


    An excellent site for learning DirectX7, 8 & 9 (for VB6, C# & VB.net) would be: directx4vb.vbgamer.com --- For my projects and games see: pieper.freehostia.com

  21. #21

    Thread Starter
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,628

    Re: Wormipede and source(vb6, dx7, English)

    don't mention it. I text message my wife so i am used to having texting misunderstood.
    My light show youtube page (it's made the news) www.youtube.com/@lightsofelberfeld
    Contact me on the socials www.facebook.com/lordorwell

  22. #22
    Hyperactive Member cptHotkeys's Avatar
    Join Date
    Apr 2007
    Location
    New Zealand
    Posts
    294

    Re: Wormipede and source(vb6, dx7, English)

    OMG, I was going to make a game verry much like this the other day, taken after the classic "Snake" from the old school cell phones...

    Hey Lord Orwell, would you be keen to work on a game?

    Signatures suck

  23. #23

    Thread Starter
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,628

    Re: Wormipede and source(vb6, dx7, English)

    That's funny you said that. I wrote this game because our new cell phones didn't have the game, and my wife complained. Took about a day.

    I had ideas for it but i am lazy. I have also written in the past a game like Collapse (but no sound) completely in VBA as a Word macro on a vba form, a tetris clone, but with extra shapes that appear at higher levels, and a remake of minesweeper.

    What kind of game did you have in mind? Tell me this, your vb version, and whether or not you want it to use Directx. If we write it in .net, i vote against using dx because i don't know how to use 9 yet.
    My light show youtube page (it's made the news) www.youtube.com/@lightsofelberfeld
    Contact me on the socials www.facebook.com/lordorwell

  24. #24
    Hyperactive Member cptHotkeys's Avatar
    Join Date
    Apr 2007
    Location
    New Zealand
    Posts
    294

    Re: Wormipede and source(vb6, dx7, English)

    WOW great minds think alike, I have also made a mine sweeper game, It had messy code but it worked with no bugs, I still have it somewhere, I might upload it here for the hell of it, but if anyone wanted to read it, I cant garentee that they could make sence of anything as I wrote it form top to bottom, start to finish, hacking my way through...

    I was thinking about a card game (Last card? easy logic), as Im not quite ready to attempt a 3D game yet, maybe multiplayer online...

    Signatures suck

  25. #25

    Thread Starter
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,628

    Re: Wormipede and source(vb6, dx7, English)

    i wouln't know where to begin on a 3d game Directx is also used for 2d as well though. Still need to know which version of basic? And i barely know how to add the comm control to a form, let alone use it.
    My light show youtube page (it's made the news) www.youtube.com/@lightsofelberfeld
    Contact me on the socials www.facebook.com/lordorwell

  26. #26
    Hyperactive Member cptHotkeys's Avatar
    Join Date
    Apr 2007
    Location
    New Zealand
    Posts
    294

    Re: Wormipede and source(vb6, dx7, English)

    I have never used directX, I might make up a few classes to demonstrate my ideas for the game, and then I will make a new thread...

    PS: I use VB.net 2005

    Signatures suck

  27. #27

    Thread Starter
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,628

    Re: Wormipede and source(vb6, dx7, English)

    I am pretty weak at using classes, but i'll try and puzzle it out. You will notice my Wormipede doesn't use any, although i make liberal use of custom objects.
    My light show youtube page (it's made the news) www.youtube.com/@lightsofelberfeld
    Contact me on the socials www.facebook.com/lordorwell

  28. #28
    Frenzied Member
    Join Date
    Sep 2006
    Location
    Scotland
    Posts
    1,054

    Re: Wormipede and source(vb6, dx7, English)

    I found a great 3D game written in VB 2006. It works very well and is an excellent example of how adaptable VB is.

    Attachment 58019
    Attachment 58020

    Note: You must extract the image from background.zip and place it in the textures folder of 3D Racer.zip.
    Last edited by 03myersd; Nov 10th, 2007 at 11:32 AM.

  29. #29
    Fanatic Member drivenbywhat's Avatar
    Join Date
    Jan 2007
    Location
    VA - USA
    Posts
    866

    Re: Wormipede and source(vb6, dx7, English)

    I tried your game. Unfortunately, my system isn't powerful enough to play it well. It is 933mhz & 8mb vid card I get that keyboard lag. I have to actually hold down the key for about 3 secs for the worm to move in a direction. However, it does look like a cool game.
    [vb5 & starting to move to vb2008] I appreciate the help I get from everyone. Thank you.

  30. #30

    Thread Starter
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,628

    Re: Wormipede and source(vb6, dx7, English)

    sorry about that. If i ever get the time, i am going to convert it to .net and not use directx at all. Either that or more precisely control what parts of the screen are redrawn (automatic in .net) to speed it up. It isnt the fact that the keyboard input is slow, it is that the video drawing is hogging the resources.
    My light show youtube page (it's made the news) www.youtube.com/@lightsofelberfeld
    Contact me on the socials www.facebook.com/lordorwell

  31. #31
    Fanatic Member drivenbywhat's Avatar
    Join Date
    Jan 2007
    Location
    VA - USA
    Posts
    866

    Re: Wormipede and source(vb6, dx7, English)

    Yeah, from what I read on the previous posts, it looks like if the vid card isn't good, the resources will get hogged. I would upgrade it but it's a laptop (not too much available to upgrade) and it's from 2001.
    [vb5 & starting to move to vb2008] I appreciate the help I get from everyone. Thank you.

  32. #32

    Thread Starter
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,628

    Re: Wormipede and source(vb6, dx7, English)

    here's an update i should have made aeons ago: I made some major game changes to the game, and submitted it as a contest submission. I figured out why it was maxing out the processor usage: I had a doevents in the loop. I have lowered processor usage, added new features, and tweaked the leveling for game balance. for example:
    1. The dropping flea, which leaves a random trail of mushrooms
    2. A spider introduced at level 2(?) with webs you can get stuck in. He comes to eat you if you do.
    3. Higher levels he doesn't wait for you to get stuck and goes on a spastic hunt similar to behavior in the original centipede game. This makes him VERY dangerous.

    There are other changes i don't recall right now, but basically it's more stable and the keyboard input should work for everyone now.
    Here's an updated link to the submission:
    http://www.vbforums.com/showthread.php?t=498393
    anyone is free to learn from and expand on the code as they wish. I no longer program in vb6 since it's outdated so i am releasing the game to the public domain. Have fun.
    My light show youtube page (it's made the news) www.youtube.com/@lightsofelberfeld
    Contact me on the socials www.facebook.com/lordorwell

  33. #33

    Thread Starter
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,628

    Re: Wormipede and source(vb6, dx7, English)

    Error from the programmer: I uploaded updated source files for the code submission, but evidently didn't recompile it first. If you download the code sample to view in vb6, delete the .exe file. it's from a much older version of the program and doesn't include the advanced features the newer version of the game has. Nothing i can do about it now since the thread is locked. I will see if i can get a mod to delete the .exe from it.
    My light show youtube page (it's made the news) www.youtube.com/@lightsofelberfeld
    Contact me on the socials www.facebook.com/lordorwell

  34. #34
    Stack Overflow mod​erator
    Join Date
    May 2008
    Location
    British Columbia, Canada
    Posts
    2,824

    Re: Wormipede and source(vb6, dx7, English)

    I don't have a VB6 compiler. Could you please post another exe here, please?

  35. #35

    Thread Starter
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,628

    Re: Wormipede and source(vb6, dx7, English)

    it's against forum rules to upload an .exe. Have someone compile it for you.

    Besides which, i don't program in vb6 anymore either and no longer have a compiler.
    My light show youtube page (it's made the news) www.youtube.com/@lightsofelberfeld
    Contact me on the socials www.facebook.com/lordorwell

  36. #36
    Stack Overflow mod​erator
    Join Date
    May 2008
    Location
    British Columbia, Canada
    Posts
    2,824

    Red face Re: Wormipede and source(vb6, dx7, English)

    In the rules (I made sure to look through them thouroughly), it says something along the lines of: "Feel free to upload an exe for your game, but note that less people will download them."

    Anyways, I don't have anybody who could compile it for me.

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