2D grap engine
|HW|SirButcher
Posted: Jan 27 2008, 11:43 AM


Sir Butcher


Group: HW Staff
Posts: 125
Member No.: 12
Joined: 18-January 08



This is a single graph engine used to move characthers in a single 2D enviroment to look like it is 3D. Made with my friend in VB.NET

CODE

Dim p1, p2 As Point
Dim x, z, b, i, y, x2 As Single


Mouseclick sub

       p1.X = picturebox.Left
       p1.Y = picturebox.Top
       z = p2.X - p1.X
       b = p2.Y - p1.Y
       x = 0
       y = p1.Y
       x2 = p1.X
       i = 0
       Do
           If z < 0 Then
               x = x - 1
               i = (x * B) / Math.Abs(z)
               p1.X = Math.Abs(x) - x2
               p1.Y = y - i
           Else
               x = x + 1
               i = (x * B) / z
               p1.X = x + x2
               p1.Y = y + i
           End If
           picturebox.Left = Math.Abs(p1.X)
           picturebox.Top = p1.Y
       Loop Until x = z
       p1.X = p2.X
       p1.Y = p2.Y

Mousemove sub

       p2.X = e.X
       p2.Y = e.Y

------------------------------------------------------------------

Thats all. Dont forget to put the imagebox to right place, and dont forget to change its name, or change inside the code. It still have some (pretty strange) problem, if you find any solution, pls post it smile.gif Thx


--------------------
A nobleman, looking for some meaning of life (and a horse and a flaming sword off course)

So big question of life: Are there life before the death?
Top
|HW|ep0xy
Posted: Jan 27 2008, 03:05 PM


Darren


Group: HW Staff
Posts: 31
Member No.: 9
Joined: 20-December 07



I'll see what i can do with it


--------------------
user posted image
Top
|HW|Hexes
Posted: Jan 27 2008, 04:10 PM


Hexes


Group: Admin
Posts: 31
Member No.: 1
Joined: 27-September 07



Very simple but everything starts from basics smile.gif nice job.
Top
|HW|SirButcher
Posted: Jan 27 2008, 08:22 PM


Sir Butcher


Group: HW Staff
Posts: 125
Member No.: 12
Joined: 18-January 08



Well simple yes smile.gif But for an adventure game where you control your character by clicking great smile.gif


--------------------
A nobleman, looking for some meaning of life (and a horse and a flaming sword off course)

So big question of life: Are there life before the death?
Top


Topic Options




Hosted for free by InvisionFree (Terms of Use: Updated 7/7/05) | Powered by Invision Power Board v1.3 Final © 2003 IPS, Inc.
Page creation time: 3.2464 seconds | Archive
Skin created by Hexes. From Hexes Word