Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

VB6 Tron Game

VB6 Tron Game

VB6 Tron Game

I am having difficulty with a school assignment. We have to create a Tron game and I am having trouble with the part where if a player hits their or another player's trail, it is game over. The teacher told us that we should use intColour = CStr(PictureBox.Point(intX, intY)) and checking whether the intColour matches a trail colour. The problem is though that I am constantly hitting my own trail. The code I have written so far is down below. I added a file to make it easier. The file attached below is the work I have done so far.

RE: VB6 Tron Game

My first guess would be that you are checking the trail colour AFTER you have moved, which means you will be peeking at your own colour. I'll have a quick look at the code you have provided when I get a moment to see if this is confirmed ...

RE: VB6 Tron Game

Yep, that's pretty much what is happening. You need to do the check in tmrGamePlay_Timer before you call picField.PSet (intUserX, intUserY), RGB(66, 135, 245)

RE: VB6 Tron Game


RE: VB6 Tron Game

Thank you. I manage to solve the problem.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close