|
-
Jun 24th, 2007, 07:36 PM
#1
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
-
Jun 25th, 2007, 04:35 AM
#2
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)
-
Jun 25th, 2007, 04:36 AM
#3
Hyperactive Member
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
-
Jun 25th, 2007, 04:43 AM
#4
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.
-
Jun 25th, 2007, 04:55 AM
#5
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.
-
Jun 25th, 2007, 07:09 AM
#6
Junior Member
Re: Wormipede and source(vb6, dx7, English)
My arrow keys lag... Gotta spam it a few times to get it in the right direction...
-
Jun 25th, 2007, 10:12 AM
#7
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.
-
Jun 25th, 2007, 12:20 PM
#8
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.
-
Jun 25th, 2007, 03:30 PM
#9
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.
-
Jun 25th, 2007, 07:09 PM
#10
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.
-
Jun 26th, 2007, 02:44 AM
#11
-
Jun 26th, 2007, 04:16 AM
#12
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?
-
Jun 26th, 2007, 05:08 AM
#13
Hyperactive Member
Re: Wormipede and source(vb6, dx7, English)
You have a loop inside a timer? Are you insane?
-
Jun 26th, 2007, 09:02 AM
#14
Re: Wormipede and source(vb6, dx7, English)
It doesn't lag at my system though. well, there are still room for improvements.
-
Jun 26th, 2007, 01:34 PM
#15
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.
-
Jun 26th, 2007, 04:07 PM
#16
Hyperactive Member
Re: Wormipede and source(vb6, dx7, English)
Yes you do, You sly dog....
-
Jun 26th, 2007, 07:05 PM
#17
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.
-
Jun 26th, 2007, 10:22 PM
#18
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
-
Jun 26th, 2007, 11:20 PM
#19
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.
-
Jun 27th, 2007, 02:36 AM
#20
Hyperactive Member
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
-
Jun 27th, 2007, 03:11 AM
#21
Re: Wormipede and source(vb6, dx7, English)
don't mention it. I text message my wife so i am used to having texting misunderstood.
-
Jul 4th, 2007, 08:36 PM
#22
Hyperactive Member
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?
-
Jul 4th, 2007, 10:35 PM
#23
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.
-
Jul 5th, 2007, 06:39 PM
#24
Hyperactive Member
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...
-
Jul 5th, 2007, 07:30 PM
#25
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.
-
Jul 5th, 2007, 08:07 PM
#26
Hyperactive Member
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
-
Jul 5th, 2007, 09:51 PM
#27
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.
-
Jul 6th, 2007, 10:14 AM
#28
Frenzied Member
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.
-
Aug 4th, 2007, 08:32 PM
#29
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. 
-
Aug 5th, 2007, 03:29 AM
#30
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.
-
Aug 5th, 2007, 04:11 AM
#31
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. 
-
Apr 12th, 2008, 01:09 AM
#32
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.
-
Apr 16th, 2008, 04:54 PM
#33
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.
-
Feb 8th, 2009, 09:59 PM
#34
Re: Wormipede and source(vb6, dx7, English)
I don't have a VB6 compiler. Could you please post another exe here, please?
-
Feb 8th, 2009, 11:27 PM
#35
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.
-
Feb 9th, 2009, 02:18 PM
#36
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|