Wrox Programmer Forums
|
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 3rd, 2008, 01:14 PM
Registered User
 
Join Date: Jan 2008
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

the snake very fast goes down and I cant drive it with keys.. maybe something is wrong wrote..

 
Old January 3rd, 2008, 01:26 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

well.. i don't see any hock for the keys, I don't see any way to move it with keys.. also, where do you move the snake? maybe you can slow it down pausing the program for a while?

HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
My programs achieved a new certification (can you say the same?):
WORKS ON MY MACHINE
http://www.codinghorror.com/blog/archives/000818.html
================================================== =========
I know that CVS was evil, and now i got the proof:
http://worsethanfailure.com/Articles...-Hate-You.aspx
================================================== =========
 
Old January 4th, 2008, 10:44 AM
Registered User
 
Join Date: Jan 2008
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

ok.. if I input to program code this text? in beginning:
Dim Direction As Byte
Private Const dLEFT As Byte = 1
Private Const dUP As Byte = 2
Private Const dRIGHT As Byte = 3
Private Const dDOWN As Byte = 4

and after this:
Public Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 37 And Direction <> dRIGHT Then 'Left
  Direction = dLEFT
' Call DrawSnake(dLEFT)
ElseIf KeyCode = 38 And Direction <> dDOWN Then 'Up
  Direction = dUP
' Call DrawSnake(dUP)
ElseIf KeyCode = 39 And Direction <> dLEFT Then 'Right
  Direction = dRIGHT
' Call DrawSnake(dRIGHT)
ElseIf KeyCode = 40 And Direction <> dUP Then 'Down
  Direction = dDOWN
' Call DrawSnake(dDOWN)
End If
End Sub

is here moving or not? specifically I dont know..:( yet.. because I want to learn it..

 
Old January 4th, 2008, 10:47 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

Well, I don't know.. what happend when you run this code??

you are asking me to understand code without having the full picture, you will get better answers from me if you have specific problems. ;)

HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
My programs achieved a new certification (can you say the same?):
WORKS ON MY MACHINE
http://www.codinghorror.com/blog/archives/000818.html
================================================== =========
I know that CVS was evil, and now i got the proof:
http://worsethanfailure.com/Articles...-Hate-You.aspx
================================================== =========





Similar Threads
Thread Thread Starter Forum Replies Last Post
Pong Game Help -XM- BOOK: Professional XNA Game Programming: For Xbox 360 and Windows ISBN: 978-0-470-12677-6 4 June 20th, 2007 02:23 PM
SNAKE AND LADDER GAME saptarshi Pro VB Databases 1 January 24th, 2007 11:31 AM
SNAKE AND LADDER GAME saptarshi Beginning VB 6 0 January 24th, 2007 10:57 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.