Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

Posted

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,

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

Posted

.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

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...