Side Scrolling Help plz.

p_dog_2007

Active member
Joined
Sep 6, 2003
Messages
28
Location
MIchigan
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
 
hey,

heres 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:

Code:
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:
Code:
If Mario.Left > (Form1.Left + Form1.Width) this is the Form 1s 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,
 
.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, youll get ".right"(there is no .right, youll just get the right edge of the picturebox
 
Back
Top