Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK .NET / Accessing Objects

Author
Message
madmunkey
11
Years of Service
User Offline
Joined: 9th May 2012
Location: United Kingdom
Posted: 11th May 2012 13:18
Hi All,

Finally managed to get DarkGDK.Net working so now im playing around trying to learn it as i've never done any game programming before, anyways...

I am doing a loop to create cubes (walls in an array on x/y)

For x = 0 To 100
For y = 0 To 100
Dim cube As DarkGDK.Basic3D.Cube
cube = New DarkGDK.Basic3D.Cube(10, texture)
cube.Scale(15, 10, 15)
cube.Position(1.5 * x, 0, 1.5 * y)
cube.Collidable = True
WallDataArray.Add(cube.Id)
Next
Next

How do I later access these cubes? I wanted to do a loop to check to see if each one is 'InScreen' then make is visible or not depending on this?

Cheers
madmunkey
11
Years of Service
User Offline
Joined: 9th May 2012
Location: United Kingdom
Posted: 11th May 2012 23:17
I Managed to kind of work out how to do this by keeping an array of all the objects I create and then loop though that array but is that the correct way of doing it?

How does collision then work do you have to loop though every object to see if it returns true? would this not be really slow?

I want to try and make a dungeon crawler type game so I am creating cubes (walls) then I will set the camera as a cube will I have to do as above and keep looping though every wall to see if it returns a true?

Sorry if these are stupid questions or if anyone can point me to some good info to read up about game programming (Im getting though all the tutorials jojoofu created)
madmunkey
11
Years of Service
User Offline
Joined: 9th May 2012
Location: United Kingdom
Posted: 14th May 2012 13:27
Can any one help me out with my list of questions below...

How do I detect a key press (up then down) at the moment I would do it as follows but this locks up the game till the button is released (not good)



How do I get the light to follow the player?

I tried

Lighting.Light.Position(DefaultCamera.CurrentPositionX, DefaultCamera.CurrentPositionY, DefaultCamera.CurrentPositionZ)

But this does not seem to have much affect.

Also not sure if anyone can help with this but my game is made up of cubes (15,10,15) I want my camera to be in the centre of on of there cubes which I can do but as you spin round the camera will go though a wall

here is a bit of example code..

madmunkey
11
Years of Service
User Offline
Joined: 9th May 2012
Location: United Kingdom
Posted: 14th May 2012 15:49
OK Well I answered my first question so what I did was (as I wanted the control to work off the view port being embedded) as

In the Main Form as a KeyDown Event


Then in my Gameloop check for a change in the Keypressed Value and then clear it
madmunkey
11
Years of Service
User Offline
Joined: 9th May 2012
Location: United Kingdom
Posted: 14th May 2012 16:46
Example of my Camera moving issue.

All is fine then I turnleft and the wall should be in front of me but instead im looking though the wall

Login to post a reply

Server time is: 2024-04-25 01:39:33
Your offset time is: 2024-04-25 01:39:33