|
-
Dec 20th, 2001, 09:52 PM
#1
Thread Starter
Lively Member
Grids?
I have a simple level editor (incomplete) that I'm making for a maze I'm making in Visual C++ (in OpenGL).
Right now, I am up to the point where I can make lines appear (Will someday be walls!), but they are very unorderly, and there would be holes all over my map.
I've attached (I think I did, I've never attached a file before) my maze, so you can see what I'm trying to do. I want to know how I could make it snap onto the grid (Right now its just a bunch of blue lines).
Help would be very appreciated
-
Dec 20th, 2001, 09:56 PM
#2
Thread Starter
Lively Member
Ah, I suppose some code may help...
I forgot to attach/post code, so if you need it here it is.
Dim Outline1 As Integer
Dim Outline2 As Integer
Private Sub cmdA_Click()
Outline1 = True
End Sub
Private Sub Command1_Click()
Static WallNum As Integer
WallNum = WallNum + 1
Load Wall(WallNum)
Wall(WallNum).X1 = Circle1.Left
Wall(WallNum).X2 = Circle2.Left ' - 70
Wall(WallNum).Y1 = Circle1.Top ' - 70
Wall(WallNum).Y2 = Circle2.Top '- 70
Wall(WallNum).Visible = True
End Sub
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Outline2 = True Then
Circle2.Top = Y - 70
Circle2.Left = X - 70
Outline1 = False
Outline2 = False
End If
If Outline1 = True Then
Circle1.Top = Y - 70
Circle1.Left = X - 70
Outline1 = False
Outline2 = True
End If
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Label1.Caption = X & ", " & Y
End Sub
Private Sub Timer1_Timer()
End Sub
Private Sub mnuExit_Click()
End
End Sub
Private Sub mnuNewMap_Click()
WallNum = 0
End Sub
Private Sub mnuSimpInst_Click()
MsgBox "To make a wall, click the outline button. Then, click the mouse button twice (different spots on the map for each click) then click create wall... A line will appear. This is a wall. Cant compile yet."
End Sub
-
Dec 21st, 2001, 12:10 AM
#3
Addicted Member
Hey dude, are you sure that code is VC++? It sure looks like VB to me. Sorry, I don't know how to fix what you're doing.
Drewski
-
Dec 21st, 2001, 06:37 AM
#4
Thread Starter
Lively Member
The game is VC++, but the level editor is VB
What I'm trying to do is make it so that the lines that you can place will snap on to a grid.
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
|