AshinoxVGs's Profile User Rating: -----

Reputation: 0 Apprentice
Group:
New Members
Active Posts:
9 (0.02 per day)
Joined:
11-December 12
Profile Views:
160
Last Active:
User is offline Dec 13 2012 11:15 AM
Currently:
Offline

Previous Fields

Dream Kudos:
0
Icon   AshinoxVGs I'm exploding out the seems... need to get my project done in seven days ;-;

Posts I've Made

  1. In Topic: Problems with Arrays...

    Posted 12 Dec 2012

    View Posttrevster344, on 12 December 2012 - 02:20 PM, said:

    You're welcome AshinoxVGs. :)/> Don't forget to come back if you have another problem.


    I will, and I'm going to assume it won't be long until I DO come back :tt2:
  2. In Topic: Problems with Arrays...

    Posted 12 Dec 2012

    I DID IT!
    ALL I DID WAS ADD
                Me.Controls.Add(NewBat)
                Me.Controls.Add(NewSlime)
    
    

    TO MY SPAWN LOOP! THANK YOU SO MUCH TREVSTER!
    I LOVE YOU! (As much as a stranger can love another stranger)
  3. In Topic: Problems with Arrays...

    Posted 12 Dec 2012

    View Posttrevster344, on 12 December 2012 - 12:00 PM, said:

    Okay well you can use a for each loop which will run through each element in an array, or list, or whatever allowing you to search for conditions or whatever you want.

    For each Sprite as Picturebox in PictureboxList
    
    'code here
    
    Next
    
    


    There are more advanced ways to do this, but I won't list them lol.

    I'VE DONE IT... kind of.

    They're spawning and the attributes are there... except they apparently don't like to spawn with their sprites showing. In other words... THEY'RE INVISIBLE! What do I do? I mean, they SHOULD be spawning with a picture...
            For Me.i = 0 To 1
                Dim NewBat As New PictureBox
                Dim NewSlime As New PictureBox
                NewBat.Size = New Size(50, 50)
                NewSlime.Size = New Size(50, 25)
                NewBat.Location = New Point(367, 211)
                NewSlime.Location = New Point(367, 211)
                NewBat.BackgroundImage = My.Resources.Bat
                NewSlime.BackgroundImage = My.Resources.slime
                Batbox.Add(NewBat)
                Slimebox.Add(NewSlime)
            Next i
    
    

    ... Right?
  4. In Topic: Problems with Arrays...

    Posted 12 Dec 2012

    View Posttrevster344, on 12 December 2012 - 11:28 AM, said:

    View PostAshinoxVGs, on 12 December 2012 - 12:07 PM, said:

    View Posttrevster344, on 12 December 2012 - 11:02 AM, said:

    I'd say just create a List(Of Picturebox) and store them in that.

    Yes that would make it accessible.

    On a side note I'd definitely suggest not relying on picturebox's so heavily. Should my tutorial be approved soon I'll give you a link to it. It goes over Drawing, and the Picturebox, both pros and cons, and the basics of each when it comes to game creation as well as usage.

    Also did you try using a breakpoint to double check all your values are correct?


    I'm not entirely sure on Lists. Do I have to have all the picture boxes already there? and if I do, could I just have four or five picture boxes and it cycles through them?
    Another question, if I can't use picture boxes, what else could I use to make my monsters?
    I'm still fairly new to VB.net, only started it in september ://>/>/>/>/>/>

    and yeah, I put a break-point and everything looks fine and dandy.

    View PostDarenR, on 12 December 2012 - 11:03 AM, said:

    did you try putting a stopper on the for loop and f10 the thing until you get the error?


    I get the error on the if... statement.


    Dim ListBox as new List(Of Picturebox)
    
    For i = 0 to 1
    Dim Newpic as new Picturebox
    Listbox.add(NewPic)
    Next
    
    
    


    You can use a for each loop to run through all the items in the list as well.

    You can use drawing. Which uses the System.drawing.graphics object to grab the handle to a child window, or parent window for drawing.

    Dim G as System.Drawing.Graphics = System.Drawing.Graphics.FromHwnd(Me.Handle) 'form1.handle
    Dim MyImage as Image = Image.FromFile("C:\testpic.jpg")
    G.DrawImage(MyImage, NewPoint(50, 50)) 'Draws the image at the specified point in the handle given to it.
    G.dispose
    
    

    Well, I've switched to using lists, but not I need to figure out how to set up my other attributes for the newly created pictures. For example, my attack collision. How will I check if my attack is hitting the newly formed picture box?

    Quote

    If you're not completely familiar with objects, or the fundamentals of Object Oriented Programming then I'd say pause your project here, and go learn that. Practice it, gain a solid understanding of it.

    Best source here: OOP Fundamentals - MSDN


    I really wish I could :/
    Unfortunately, I have roughly Seven days to finish this, as this is my final project for my Computer Science class... as I've said before, I'm notorious for biting off more than I can chew :/
  5. In Topic: Problems with Arrays...

    Posted 12 Dec 2012

    View Postlucky3, on 12 December 2012 - 11:16 AM, said:

    300 lines of code for one single class? This is so called spaghetti code. I just skimmed through your code, and have seen some confusing things: variable i, strange usage of for loops (I can't really explain to myself what should be the point of For Me.i = 1 To 1 and For x = 1 To 1...). In my opinion, you should refactor your code, separate concerns, and do some debugging.

    If you get error message, telling you that you need to instantiate object first, before you use it, then do it. You can't add non existing picturebox to controls (you can't add nothing).

    Like I've said, I'm fairly new to VB.net (heck, coding in general) and my teacher hasn't taught me any of the things you're talking about. And I had my arrays linked to a picture once and it went a little like this:
    Bats(i) = picEnemy1
    Slime(i) = picEnemy2
    
    


    and all it would do is just move the picture... which isn't what I wanted :/
    I just want to finish this project...

My Information

Member Title:
New D.I.C Head
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:

Contact Information

E-mail:
Private

Friends

AshinoxVGs hasn't added any friends yet.

Comments

AshinoxVGs has no profile comments yet. Why not say hello?