Results 1 to 5 of 5

Thread: [RESOLVED] Bitmap Collision Detection?

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2014
    Posts
    14

    Resolved [RESOLVED] Bitmap Collision Detection?

    Could Anybody Help Me With This?

    I Have A Bitmap I drawed On The Form With: e.graphics.DrawImage(MyBmp,Location), (Location = 10,10 BTW)

    I Already have Movement Figured Out For The Bitmap, But How Would I detect If Im Colliding With A Panel?

    I Have Tried:

    If Location.Y = 256 And Location.X = 256 Then
    MessageBox.Show("Hi") Then
    End if




    But Unfortunately This Does Not Work

    Could Anybody Help Me? Sorry If You Dont Understand I am Horrible At Explaining Things


    EDIT: Here is My Code if anyone needs it....


    Dim Character As New Bitmap("C:\ArtofBlood\Data\Art\Guy1.png")
    Dim Speed As Integer = 10

    Dim Location As Point
    Private Sub Form1_KeyDown(sender As Object, e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
    Select Case e.KeyCode
    Case Keys.W

    Location.Y += Speed

    End Select
    Me.Refresh()
    End Sub

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    Location = New Point(10, 10)
    DoubleBuffered = True
    End Sub

    Private Sub Form1_Paint(sender As Object, e As PaintEventArgs) Handles Me.Paint
    e.Graphics.DrawImage(Character, Location)
    End Sub
    Last edited by redstonguy3442; Aug 6th, 2014 at 06:20 PM. Reason: Add My Source Code

Tags for this Thread

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