|
-
Jun 9th, 2000, 02:27 AM
#1
Thread Starter
Frenzied Member
Im making an online game. Its coming along very well so far. But for later versions of the game I would like to be able to make more maps. I want to know how to make a map editor that uses BitBlt. All I need is two things, walkable areas and nonwalkable areas. Any help will be a big help.
-
Jun 9th, 2000, 04:20 AM
#2
PowerPoster
Try to save the tile indexes in a 2D array. Then in the tiles you can store information like collidable and picture and stuff... like this:
Code:
'Types
Type tTile
Picture as Long
Collidable as Boolean
End Type
'Tiles
Global TileCount as Long
Gloabl Tile() as tTile
'Map
Global Map(100,100) as Long
-
Jun 10th, 2000, 03:03 AM
#3
Thread Starter
Frenzied Member
Okay, so my map would be 100 * 100? And collidable objects are called collidable? If I wanted my map bigger then I could just replace the 100s? Thanks fox.
-
Jun 10th, 2000, 03:38 AM
#4
PowerPoster
Jup, or resize it at runtime:
Code:
dim Map() as tTile
dim Width as Long
dim Height as Long
'Code
Width = 300
Height = 200
Redim Map(Width, Height)
-
Jun 10th, 2000, 04:10 AM
#5
Thread Starter
Frenzied Member
-
Jun 10th, 2000, 07:27 AM
#6
transcendental analytic
you could use ubound(map,1) and ubound(map,2) and create a property height and width, but maybe it's a slower way to retrieve the vars, maybe Fox's right it's better to use as much vars as possible if you want performance.
But Redim Preserve Map(Width, Height) won't erase all the data after rediming
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jun 10th, 2000, 10:01 AM
#7
-
Jun 10th, 2000, 10:01 AM
#8
PowerPoster
oh man, it's 5 0'clock am now.. I really should go sleepin'... c'ya!
-
Jun 10th, 2000, 03:34 PM
#9
transcendental analytic
youre up early then fox, or do you sleep online?
yeah I forgot, you can just preserve the later argument
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jun 10th, 2000, 05:37 PM
#10
PowerPoster
I'm always online... and I was up till 5.00am
-
Jun 10th, 2000, 05:59 PM
#11
transcendental analytic
Me too, but i went offline 4am and tested vb6, but it was german!
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jun 10th, 2000, 10:45 PM
#12
Thread Starter
Frenzied Member
Im traveling right now so I can't try out the code yet When I get back later today I'll tell you how it went.
Just want to make sure. So in my map, I would just have to call something collidable and then it will work? After I tell my program what to do when it sees something collidable of course.
-
Jun 11th, 2000, 02:17 AM
#13
PowerPoster
In my tile array every tile can have several values, collidable for example. Of course you later have to check if the tile collides and if not don't move the player or whatever, I just showed you the structure...
-
Jun 11th, 2000, 04:49 AM
#14
Thread Starter
Frenzied Member
Thats what I thought. But can I tell what side is colliding with something else? So if my guys hits a wall from the front I can tell? So i can stop him from going forward?
-
Jun 11th, 2000, 05:35 AM
#15
Thread Starter
Frenzied Member
error...I put this in a module...and i get an error on this line...
Gloabl Tile() as tTile
-
Jun 11th, 2000, 05:54 AM
#16
transcendental analytic
It's a typo: Global
You need to do a property for the movement, when you change the position, your property should check for walls in that direction and refuse to move if there is
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jun 11th, 2000, 06:50 AM
#17
Thread Starter
Frenzied Member
What do you mean properties kedaman? How do I do this? Ambiguous Name Detected, "tTile". I get an error in a module and declarations of a form.
(oh duh! I wasn't looking at the code when I copied it. Sorry)
-
Jun 11th, 2000, 07:55 AM
#18
transcendental analytic
I'm not sure what youre doing so i can't suit it for your needs but i can give an example:
Code:
Private Type pos2d
x As Integer
y As Integer
End Type
Private Pguypos As pos2d
Dim Velocity As pos2d
Private Property Get guypos() As pos2d
guypos = Pguypos
End Property
Private Property Let guypos(newval As pos2d)
If Not map(newval.x, newval.y).Collidable Then
Pguypos = newval
End If
End Property
Sub moveguy()
guypos = posadd(guypos, Velocity)
End Sub
Private Function posadd(arg1 As pos2d, arg2 As pos2d) As pos2d
posadd.x = arg1.x + arg2.x
posadd.y = arg1.y + arg2.y
End Function
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|