Post

 Resources 

Console

Home | Profile | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 VBGamer
 VBGamer
 Move the camera on DirectDraw7, if we have one...

Note: You must be registered in order to post a reply.

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List Spell Checker
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

   Insert an File
Check here to include your profile signature.
Check here to subscribe to this topic.
    

T O P I C    R E V I E W
Saga Posted - May 02 2004 : 5:49:01 PM
Ok, first of all lemme explain what I wanna do:

I'm making a isometric-viewed RPG, and, as any other RPG, the camera gotta "pan" thru the scene sometimes, or follow the main guy. How do I move the camera (if we have one) thru the scene without having to move each DD7Surface? hope u have understood it. thanx and c ya!
4   L A T E S T    R E P L I E S    (Newest First)
Saga Posted - May 02 2004 : 7:12:44 PM
hey! I didn't tested it out yet but, thanx in advance, really! c ya around!
sdw Posted - May 02 2004 : 6:56:39 PM
My previous post is for 2D
sdw Posted - May 02 2004 : 6:55:21 PM
I'm not sure what you mean by 'not moving each DD7Surface', but I can tell you how the camera works. You draw the tilemap based on the camera's coordinates and you can set the camera coordinates based on the playing character's coordinates. Example:
  
Private Type MAP_TILE  
X as long
Y as long
End Type
  
Private Type CAMERA_POS  
X as long
Y as long
End Type
  
Dim Tile(100,100) as MAP_TILE  
Dim CameraPos as CAMERA_POS  
  
Private sub DrawMap()  
Dim X as long, Y as long
For X = CameraPos.X \ 32to CameraPos.X \ 32 + 20 'Based on 640x480 and 32x32 tiles  
  For Y = CameraPos.Y \ 32 to CameraPos.Y \ 32 + 15 'Again, based on 640x480 resolution and 32x32 tiles  
    Draw Tile(X,Y)  
  Next Y  
Next X  
  
End Sub
  

Of course you fill in whatever the tilesize you're using and change the 20 and 15 to the number of tiles that will fit across the screen vertically and horrizontally. Then if you wanted to make the camera follow your main character then you would just add something to ur code like:
  
CameraPos.X = MyChar.X - 320 'based on 640x480  
Camerapos.Y = MyChar.Y - 240 'based on 640x480  
  
If CameraPos.X < 0 Then CameraPos.X = 0  
If CameraPos.Y < 0 Then CameraPos.Y = 0  
If CameraPos.X + 640 > MapWidth Then CameraPos.X = Mapwidth - 640  
If CameraPos.Y + 480 > MapHeight Then CameraPos.Y = MapHeight - 480  
  
Eric Coleman Posted - May 02 2004 : 6:46:47 PM
Are you using 3D?

VBGamer © Go To Top Of Page
This page was generated in 0.12 seconds. Snitz Forums 2000

Copyright © 2002 - 2004 Eric Coleman, Peter Kuchnio , et. al.