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.

Newcomers DBPro Corner / My First Maze Game

Author
Message
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 12th Dec 2004 11:36
First of all, Hi, I\'m RUCCUS. Ok, now then, after thouroughly studying the \"My First Pong Game\" and learning about how all the code goes together and creating a nifty little game of my own, I am beginning a simple maze game. Basically the idea is that you\'re a simple little cube that walks around in a maze of rectangles connected together, and once you reach the exit you win. So I figure what I\'m going to need to create for the bones is...
- A movable box
- Collision so the user can\'t run everywhere going through the walls
- A special box at the end that detects when the user enters the box and once this happens alerts the user that they\'ve won and ends the game

I have the moving of the box down, you can go left right up and down. Now I\'m trying to figure out how to make a simple collision code that just detects when the user bumps into anything and disallows them to walk there. I searched the forums and got confused by a few examples, and when I tried changing the Pong Bounce back code I got all jumbled up, so I\'m consulting the forums. Is there anyone out there that can help me along with making a simple collision code much like the pong tutorial was made or possibly point me to a very useful tutorial that covers simple collision? All help is appretiated, thanks in advance if I forget to say it later on.

Oh and by the way here\'s my code so far, remember it\'s just the bare bones and this is only my second program in DB so don\'t flame it too much lol.


Causin' RUCCUS whereva' I go.
Ali M Oldboy
19
Years of Service
User Offline
Joined: 6th Nov 2004
Location: England, UK
Posted: 12th Dec 2004 17:58


and



Or whatever your pong players are

Are you mad? I am! :: Welcome to our world! ::
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 12th Dec 2004 21:21
Thanks I'll try it.

Causin' RUCCUS whereva' I go.
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 12th Dec 2004 21:34
I tried using what you said and it didn't work so I looked it up and I think you meant (from what I read on the help file) set object collision on 1, so I tried putting this in and there weren't any errors but I could still go through the other box on the map. So I tried setting it for both object 1 and 2 and still nothing, I even added in set global collision on and no errors but I could go through the object. Am I supposed to be writing something that returns when the collision is detected to disallow it or is there some variable I have wrong, I'm gona try switching the 1 and 2 with player# but I don't think it'll work. Sorry for not completely understanding what is probably a really easy task, I'm trying my best.

Causin' RUCCUS whereva' I go.
Dgamer
21
Years of Service
User Offline
Joined: 30th Sep 2002
Location:
Posted: 13th Dec 2004 00:04 Edited at: 13th Dec 2004 00:06
Quote: "+ Code Snippet

Set Object Collision 1



and

+ Code Snippet

Set Object Collision 2



Or whatever your pong players are
"



What the hell is that supposed to do?

What i would do is every time the player moves, i would check for collision with any object. If there is, simply move it to the last known good position. Then record its position so it can backtrack the next time it collides.

Pseudo-Code


This sig has been dullified!

Login to post a reply

Server time is: 2024-09-23 06:30:48
Your offset time is: 2024-09-23 06:30:48