scrolling tile map demos needed
scrolling tile map demos needed
scrolling tile map demos needed
scrolling tile map demos needed
scrolling tile map demos needed
scrolling tile map demos needed scrolling tile map demos needed scrolling tile map demos needed scrolling tile map demos needed scrolling tile map demos needed scrolling tile map demos needed scrolling tile map demos needed scrolling tile map demos needed
scrolling tile map demos needed scrolling tile map demos needed
scrolling tile map demos needed
Go Back  Xtreme Visual Basic Talk > > > scrolling tile map demos needed


Reply
 
Thread Tools Display Modes
  #1  
Old 07-24-2005, 07:00 PM
wolfstrike's Avatar
wolfstrike wolfstrike is offline
Junior Contributor
 
Join Date: Aug 2004
Posts: 336
Default scrolling tile map demos needed


if you know any demos showing examples of scrolling tile maps please post them i haven't been able to find any.
__________________
The Pho·net·ic Programmer
Reply With Quote
  #2  
Old 07-24-2005, 07:20 PM
TeraBlight's Avatar
TeraBlightscrolling tile map demos needed TeraBlight is offline
Captain Convoluted

* Expert *
 
Join Date: Jun 2005
Posts: 1,918
Default

You can't have looked very carefully, because BillSoo has a whole thread on scrolling tile maps in the code library
http://www.xtremevbtalk.com/showthread.php?p=123258
__________________
"To learn without thinking is to labour in vain" - Confucius
Reply With Quote
  #3  
Old 07-24-2005, 07:55 PM
Spodi's Avatar
Spodi Spodi is offline
Junior Contributor
 
Join Date: Oct 2003
Location: Washington, USA
Posts: 201
Default

There are also many types of code like this on www.pscode.com. I even contributed to the massive needless collection with my DXRE engine. If you dont like BillSoo's engine, you can check that site out. His does, though, run pretty well.
__________________
vbGORE :: Opensource Online RPG Engine
Reply With Quote
  #4  
Old 07-25-2005, 12:27 AM
wolfstrike's Avatar
wolfstrike wolfstrike is offline
Junior Contributor
 
Join Date: Aug 2004
Posts: 336
Default

the problem with BillSoo's demo is i can't figure it out.

i went to that website and found some matches , most of them are for making a game tile engine,

i can make a map but i need a demo on how to make it scroll with a ceteralized character
__________________
The Pho·net·ic Programmer
Reply With Quote
  #5  
Old 07-25-2005, 12:46 AM
Spodi's Avatar
Spodi Spodi is offline
Junior Contributor
 
Join Date: Oct 2003
Location: Washington, USA
Posts: 201
Default

The thing with BillSoo's engine is that he declares a lot of variables with %'s and $'s and whatever, confusing stuff for us who have only used VB. It just takes some adjusting to get used to it. From what it sounds like, his engine has what you want...
__________________
vbGORE :: Opensource Online RPG Engine
Reply With Quote
  #6  
Old 07-25-2005, 09:28 AM
Nitrotrigger Nitrotrigger is offline
Newcomer
 
Join Date: Jul 2005
Location: Finland
Posts: 1
Default

I think I got this code to work. Hope it will help.


Code:
    Public ScreenWidth As Long = 640
    Public ScreenHeight As Long = 480
    Public Const TileHeight As Long = 32
    Public Const TileWidth As Long = 32



    Dim SourceRect As RECT
    Dim Scaling As D3DVECTOR2
    Dim RotationCenter As D3DVECTOR2
    Dim Rotation As Single
    Dim Translation As D3DVECTOR2
    Dim Color As Long

    Dim i As Integer
    Dim j As Integer
    Dim intX As Integer
    Dim intY As Integer
    Dim tile As Integer
    Scaling.X = 1
    Scaling.Y = 1
    RotationCenter.X = 0
    RotationCenter.Y = 0
    Rotation = 0
    Color = &HFFFFFFFF
    mintX = Object.X
    mintY = Object.Y
  
        For i = 0 To CInt(ScreenWidth / TileWidth)
        For j = 0 To CInt(ScreenHeight / TileHeight)
            intX = i * TileWidth - mintX Mod TileWidth
            intY = j * TileHeight - mintY Mod TileHeight
            tile = map((intX + TileWidth \ 2 + mintX - ScreenWidth \ 2) \ TileWidth, _
            (intY + TileHeight \ 2 + mintY - ScreenHeight \ 2) \ TileHeight)

        
        
        
        With SourceRect
        
        
        .Left = 0
        .Right = TileWidth
        .Top = tile * TileHeight
        .bottom = .Top + TileHeight

        If intX < 0 Then
            .Left = .Left - intX
            intX = 0
        End If
        If intY < 0 Then
            .Top = .Top - intY
            intY = 0
        End If
        If intX + TileWidth > ScreenWidth Then
        .Right = .Right + (ScreenWidth - (intX + TileWidth))

        End If
        If intY + TileHeight > ScreenHeight Then
        .bottom = .bottom + (ScreenHeight - (intY + TileHeight))

        End If
    End With
    Translation.X = intX
    Translation.Y = intY
    
    
    
    
    D3DDevice.BeginScene
    D3DSprite.Begin
    D3DSprite.Draw Tileset, SourceRect, Scaling, RotationCenter, _
    Rotation, Translation, Color
    D3DSprite.End
    D3DDevice.EndScene

Next
Next
Reply With Quote
  #7  
Old 07-25-2005, 07:11 PM
zelg37scrolling tile map demos needed zelg37 is offline
Contributor

* Expert *
 
Join Date: Dec 2004
Location: Oregon, USA
Posts: 606
Default Scrolling tiles and old-style variable suffixes

Quote:
Originally Posted by wolfstrike
if you know any demos showing examples of scrolling tile maps please post them i haven't been able to find any.
I agree with TeraBlight, you certainly didn't look very hard. Here's a two part tutorial and a demo:
http://www.vbexplorer.com/VBExplorer/tiletutor.asp
http://www.vbexplorer.com/VBExplorer/tiletutor2.asp

...and if you are interested in DirectX tile scrolling as well:
http://rookscape.com/vbgaming/tutAR.php
http://gpwiki.org/index.php/VB:DX7_S...crolling_Tiles
http://gpwiki.org/index.php/Framing_...ling_Algorithm

In regard to the old-style variable suffixes that BillSoo uses, it's just a matter of using a cross reference table to understand the suffixes:
http://66.102.7.104/search?q=cache:i...hl=en&ie=UTF-8

Last edited by zelg37; 07-25-2005 at 07:22 PM.
Reply With Quote
  #8  
Old 07-26-2005, 02:34 PM
Mathijsken's Avatar
Mathijsken Mathijsken is offline
Contributor
 
Join Date: May 2003
Location: Oostkamp - Belgium
Posts: 730
Default

The main idea about a scrollin map is that you scroll it... Just think for yourself and come to the conclusion that it is a very simple problem: how to adjust the portion that is shown on the screen? (in a smooth way, that is) In DirectX, you can do this by moving the source rectangle, with bitblt you can do this by adjusting the source offsets and with / height parameters and if you're using VB's picturebox stuff like getPixel, then I suggest learning Dx or Bitbilt first

basic maths tells me if your character is in the center:
Code:
Map.X = Char.X + Char.Width / 2 - MapWidth / 2
Map.Y = Char.Y + Char.Height / 2 - MapHeight / 2
With X and Y each time being the coordinates of the upper left corner of the visible area in the map and the character.

Mathijsken
__________________
Fear is the first step towards intolerance.
Reply With Quote
  #9  
Old 07-26-2005, 11:04 PM
wolfstrike's Avatar
wolfstrike wolfstrike is offline
Junior Contributor
 
Join Date: Aug 2004
Posts: 336
Default

yes , i need to get the very basic ideas.
i'm using bitblt,
i've tried a few things that didn't work
__________________
The Pho·net·ic Programmer
Reply With Quote
  #10  
Old 07-27-2005, 02:57 AM
Mathijsken's Avatar
Mathijsken Mathijsken is offline
Contributor
 
Join Date: May 2003
Location: Oostkamp - Belgium
Posts: 730
Default

What about posting those blocks of code? Maybe we can tell you what to do with it.

To make it a bit more clear:
Code:
BitBlt lngDestDC, 0, 0, ViewPortWidth, ViewPortHeight, lngSourceDC, lngOffsetX, lnOffsetY, SRCCOPY

Viewportwidth being the width to be shown (same for height), lng offsetX being the amount of pixels your map has scrolled to the right, and lngoffsety: to the bottom

Mathijsken
__________________
Fear is the first step towards intolerance.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
scrolling tile map demos needed
scrolling tile map demos needed
scrolling tile map demos needed scrolling tile map demos needed
scrolling tile map demos needed
scrolling tile map demos needed
scrolling tile map demos needed scrolling tile map demos needed scrolling tile map demos needed scrolling tile map demos needed scrolling tile map demos needed scrolling tile map demos needed scrolling tile map demos needed
scrolling tile map demos needed
scrolling tile map demos needed
 
scrolling tile map demos needed
scrolling tile map demos needed
 
-->