×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Scrolling, Please Help

Scrolling, Please Help

Scrolling, Please Help

(OP)
How do you scroll from map to map? Like, If you have two or more sets of data how do you move from one to the other? You know, like in games, when you walk off screen and you end up in another 'map'. By sets of data I mean bitmaps

data 1, 1, 1
data 1, 1, 1, 1 etc...

Please help!!!

RE: Scrolling, Please Help

Figure out where your player is on the screen

DIM SHARED bitmaps$(10,10), curbitx%, curbity%
DIM SHARED playersx%, playersy%
IF playersx% > 320 THEN
 curbitx% = curbitx% + 1
 loadbitmap
ELSEIF playersx% < 0 THEN
 curbitx% = curbitx% - 1
 loadbitmap
ELSEIF playersy% > 200 THEN
 curbity% = curbity% + 1
 loadbitmap
ELSEIF playersy% < 0 THEN
 curbity% = curbity% - 1
 loadbitmap
END

SUB Loadbitmap
OPEN bitmap$(curbitx%, curbity%) FOR BINARY AS #1
...
END SUB

I assume since you said you are using bitmaps that you already have one, if you do need one, just post again and I will post it for you.

RE: Scrolling, Please Help

Figure out where your player is on the screen

DIM SHARED bitmaps$(10,10), curbitx%, curbity%
DIM SHARED playersx%, playersy%
IF playersx% > 319 THEN
 curbitx% = curbitx% + 1
 playersx% = 0
 loadbitmap
ELSEIF playersx% < 0 THEN
 curbitx% = curbitx% - 1
 playersx% = 319
 loadbitmap
ELSEIF playersy% > 199 THEN
 curbity% = curbity% + 1
 playersy% = 0
 loadbitmap
ELSEIF playersy% < 0 THEN
 curbity% = curbity% - 1
 playersy% = 199
 loadbitmap
END

SUB Loadbitmap
OPEN bitmap$(curbitx%, curbity%) FOR BINARY AS #1
...
END SUB

I assume since you said you are using bitmaps that you already have one, if you do need one, just post again and I will post it for you.

RE: Scrolling, Please Help

(OP)
Thanks alot! But I'm not sure exactly what you mean...
I kind of get it but I'm not sure where in my source to put it or what exactly it does. Thanks again, I'll try it

Chilli-D

RE: Scrolling, Please Help

(OP)
I think I have a bitmap, that's

data 1, 1, 1,
data 1, 1, 1, 1, 1, 1 etc, right?
and does the source code you gave me scroll between two sets of data? Thanks again!

Chilli-D

RE: Scrolling, Please Help

No, well... techinically that is a bitmap, I was under the impression that you were using a bitmap file.  A drawing that you made in Paint.

Using DATA sets will be much harder to use and take up more memory, I recommend drawing your landscape in Paint and useing a bitmap file loader to draw them on the screen.

The code I posted would go after you moved your character.  ie. after the keyboard routine but before you actually draw him.

Basically what the code does is it figures out if the player is off the screen and which edge he went off of.  Then it moves to the next map accordingly.

RE: Scrolling, Please Help

(OP)
Thanks!

Chilli-D

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close