p_dog_2007 Posted September 8, 2003 Posted September 8, 2003 Im sorda new to Visual Basic(I receantly got Vb .net), Ive made a few games so far(none really complete). Anyway my new game ia a 2D shooter, the player can stand at 8 different angles, move fwd & Bck, and shoot at the 8 angles. The problem Ive ran into is i dont know how to make a backround scroll around where the player walks.I want the player to see about one square foot in the middle of the screen the rest of the map would be covered.I dont know much so if any one can help me learn how to side scroll i would appericate it. I also need to know how to make one object set properties(like a wall that a player cant go through) and then just make as many as i want and put them where ever i want. Plz help Thanks p_dog Quote
ThePentiumGuy Posted September 13, 2003 Posted September 13, 2003 hey, here's what i did with mario( i created a function in the Mario class called Collide, so it looks like Mario.Collide) Under Form1_keydown: I made a boolean called AllowedToMove, and KeyDown only works when AllowedToMove = True: If Mario.Collide(Platform) Then AllowedToMove = False ElseIf Mario.Collide(Door) Then AllowedToMove = False Else AllowedToMove = True End If i dont have my code, but i have the concept of it as for SideScrolling: I have a large bitmap(im gonna make up some numbers here). The Bitmap is 600x600, and the form size is 150x150, thus the player can only see the center of the bitmap, and can only see 150 pixels horizonally by 150 pixels vertically. What i did was, Under form1_keydown: If Mario.Left > (Form1.Left + Form1.Width) 'this is the Form 1's right,btw for my game i used GDI+ ImageXCoord+=5 e.graphics.drawimage(New Bitmap(Map), ImageXCoord,ImageYCoord, 150,150) ' the 150, 150 is the width and height basically, i add the XCoord by 5 which scrolls it, this scrolls it Blockily, but if you use a while loop and increment it by 1 until it gets to 5, it goes smoother i hope this is what u mean, Quote My VB.NET Game Programming Tutorial Site (GDI+, Direct3D, Tetris [coming soon], a full RPG.... you name it!) vbprogramming.8k.com My Project (Need VB.NET Programmers) http://workspaces.gotdotnet.com/ResolutionRPG
p_dog_2007 Posted September 15, 2003 Author Posted September 15, 2003 ok, thanks i get it but im not fermiluar with the .left command could you tell me how that works thanks Quote
ThePentiumGuy Posted September 15, 2003 Posted September 15, 2003 .left is the left side of the object if u say mypicturebox.left, thats the coordinate of the left edge of the picturebox, think about this carefully: if you add the .left coordinate and the .width coordinate, you'll get ".right"(there is no .right, you'll just get the right edge of the picturebox Quote My VB.NET Game Programming Tutorial Site (GDI+, Direct3D, Tetris [coming soon], a full RPG.... you name it!) vbprogramming.8k.com My Project (Need VB.NET Programmers) http://workspaces.gotdotnet.com/ResolutionRPG
p_dog_2007 Posted September 15, 2003 Author Posted September 15, 2003 is that the whole left side or just the top Quote
Administrators PlausiblyDamp Posted September 15, 2003 Administrators Posted September 15, 2003 The picturebox is square so left is just left. The same as the top is just the top Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.