_HAWK_'s Profile User Rating: *****

Reputation: 1059 Grandmaster
Group:
Expert
Active Posts:
4,107 (1.78 per day)
Joined:
02-July 08
Profile Views:
65,207
Last Active:
User is online 40 minutes ago
Currently:
Viewing Forum: VB.NET

Previous Fields

Country:
US
OS Preference:
Windows
Favorite Browser:
Chrome
Favorite Processor:
Intel
Favorite Gaming Platform:
XBox
Your Car:
Mazda
Dream Kudos:
125
Expert In:
VB.NET

Latest Visitors

Icon   _HAWK_ - I got your Foo right here!

Posts I've Made

  1. In Topic: Problem connecting VB.net with sql server 2008

    Posted 30 Oct 2014

    Are you sure your using the right SQL objects? Why are you using a Function that you don't use the Return value instead of a Sub?
  2. In Topic: for next loop not iterating second time

    Posted 29 Oct 2014

    Standard For Loop syntax - For i As Integer = {start} To {End}. You don't use an expression with the i variable.
  3. In Topic: Object collision in game

    Posted 29 Oct 2014

    I would use some logic check for the movement - use a Rectangle that is a projection of where the move would be based the direction they move, then if it does not collide with the other objects then move all tiles.You could store the "wall" to all of the walls in it's Tag property so we can make a collection of them like a query(see below).

    Private Sub keyDown(...) Handles lbPlayer.KeyDown
      Dim allWalls = Me.Controls.OfType(Of Label)().Where(Function(lb) lb.Tag.ToString = "wall").ToList()
      Dim checkRect As Rectangle
      Select Case e.KeyCode
        Case = Keys.W
          checkRect = New Rectangle(lbPlayer.Bounds.X, lbPlayer.Bounds.Y - 2, lbPlayer.Bounds.Width, lbPlayer.Bounds.Height)
        Case = Keys.A
          checkRect = New Rectangle(lbPlayer.Bounds.X - 2, lbPlayer.Bounds.Y, lbPlayer.Bounds.Width, lbPlayer.Bounds.Height)
        Case = Keys.S
          checkRect = New Rectangle(lbPlayer.Bounds.X, lbPlayer.Bounds.Y + 2, lbPlayer.Bounds.Width, lbPlayer.Bounds.Height)
        Case = Keys.D
          checkRect = New Rectangle(lbPlayer.Bounds.X + 2, lbPlayer.Bounds.Y, lbPlayer.Bounds.Width, lbPlayer.Bounds.Height)
      End Select
      If Not allWalls.Any(Function(r) r.IntersectsWith(checkRect)) Then
        MoveAllWalls(allWalls, e.KeyCode)
      End If
    End Sub
    
    Private Sub MoveAllWall(walls As List(Of Labels), key As Forms.Key)
      For Each lb In walls
        'provide move logic based on the key code
      Next
    End Sub
    


    Personally, I would use class objects and GDI+ with mouse/paint events for all this instead of controls, but that might be a bit advanced.
  4. In Topic: for next loop not iterating second time

    Posted 29 Oct 2014

    For loops are stated like:

    For i As Integer = 0 To 2
    


    That would be 3 iterations.

    Your variables a, b are set to 0 and you never checked for that condition. And it also has only 1 element so b(1) or b(2) will be out of bounds.
  5. In Topic: Close Running Processes

    Posted 25 Oct 2014

    I believe FreeFile is an old Legacy method. We really need to move on the the System.IO namespace for file operations.

My Information

Member Title:
Master(Of Foo)
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:
Location:
Denver Colorado
Years Programming:
4+
Programming Languages:
VB.Net
C#
XML
XAML
Regex
LINQ
ASPX
SQL

Contact Information

E-mail:
Click here to e-mail me
Website URL:
Website URL  http://

Comments

  • (3 Pages)
  • +
  • 1
  • 2
  • 3
  1. Photo

    trevster344 Icon

    16 Mar 2012 - 08:31
    Seems to be that kind of year lol.
  2. Photo

    _HAWK_ Icon

    14 Mar 2012 - 16:42
    Super busy!
  3. Photo

    trevster344 Icon

    14 Mar 2012 - 13:23
    Hey man, how have you been?
  4. Photo

    DimitriV Icon

    29 Jan 2012 - 18:56
    Go bro!
  5. Photo

    _HAWK_ Icon

    12 Dec 2011 - 20:39
    Careful that **it is addictive!!!
  6. Photo

    trevster344 Icon

    12 Dec 2011 - 16:40
    Ever since you introduced some possibilities of drawing cool graphics to me, earlier this year. I've found myself nonstop drawing everything including the simplest of things lol.
  7. Photo

    trevster344 Icon

    29 Nov 2011 - 15:20
    Yea all that weather is chilling the south quite a bit.
  8. Photo

    _HAWK_ Icon

    19 Nov 2011 - 11:15
    Not bad so far. Good snow in mountains already.
  9. Photo

    trevster344 Icon

    18 Nov 2011 - 09:15
    How's that onset of winter treating you up there in CO hawk!? I'll be up there soon to meet it head on, myself.
  10. Photo

    ricardosms Icon

    01 Nov 2011 - 03:21
    I saw your note... I took me over a week to figure it out.
    Just prepoaring for the grand oppening that never happens.
  11. Photo

    _HAWK_ Icon

    02 Oct 2011 - 05:46
    Yea!
  12. Photo

    smohd Icon

    02 Oct 2011 - 02:10
    New name ?
  13. Photo

    _HAWK_ Icon

    17 Sep 2011 - 14:34
    Cooling off - 'bout time!
  14. Photo

    trevster344 Icon

    16 Sep 2011 - 22:32
    How's that Colorado weather treating ya?
  15. Photo

    _HAWK_ Icon

    02 Aug 2011 - 20:09
    Smohd thanks, but I am sure you beat that between all your forums.
  • (3 Pages)
  • +
  • 1
  • 2
  • 3