Sounds correct to me. If the game is basic, the collision detection would merely involve checking that you are not on the same x and y coordinates as a wall etc, but if you plan to do something more advanced then the detection is not quite as trivial. Your idea regarding the structure is correct, however.

Kind regards,

Philip Bennefall
----- Original Message ----- From: "john" <[email protected]>
To: "Gamers Discussion list" <[email protected]>
Sent: Saturday, August 17, 2013 3:21 PM
Subject: Re: [Audyssey] looking for programmingadvice:cyntaxdifferencebetween bgt and java


I know it's been a while since this thread has been active, but
I'm going through my old emails, and was wondering if I could get
some more clarification on this subject. The way I'm
understanding this, you would build two functions: one for
collision detection and one for movement. The movement would run
every time through the game loop, and would call the collision
detection from within itself. The movement function would change
the player's position, call the collision detection function, and
if that returns safe, update the game world. Does this sound
somewhat correct?

Thanks,
John.

----- Original Message -----
From: Cara Quinn <[email protected]
To: Gamers Discussion list <[email protected]
Date sent: Tue, 30 Jul 2013 17:38:43 -0700
Subject: Re: [Audyssey] looking for programming
advice:cyntaxdifferencebetween bgt and java

Hi Ryan, yes and no.

If you're using collision detection, you can actually have your
player's avatar move and if he's unable to do that then the
collision detection routines can stop him for you. YOu don't even
need a flag.

If your player is moving at a slower speed and touches a wall,
then gently stop him. If he is running and touches a wall then
give him some damage, stop him and bounce him back a bit based on
his velocity. Does this make sense?

It's really the job of the collision detection to decide whether
or not your player can move.

Obviously there may be other situations you may want to check for
other than collisions but the concept of attempting the move is
what I'm getting at here.

In a real physical situation sometimes you can't walk because the
hill is too steep. Know what I mean? Nothing is really stopping
you but there's a physical reason. YOu attempt to walk but find
you cannot.

So let's look at this another way;

You're velocity is 0. You attempt to walk which simply changes
your velocity to something greater than 0.

The game loop processes your player's movement and if nothing is
preventing you from moving in the direction you want at the speed
you want then you do. Simple as that. If something is in your way
then your collision detection will stop you or move you back to
where you were and reassign your velocity to 0.


Obviously this is really primitive but do you get the idea?

Also, as Ian has mentioned, you would want to also take into
account the timing of your game loop or your frame rate as we've
been calling it as well, to manage your movements. YOu can sort
of think of this as a movie. But it's a dynamic movie with
interaction. :)

Does this make sense?

If not then by all means, just shout back out! -And I'm happy to
clarify and I'm sure Thomas, Ian and others will happily do so as
well. :)

HTH

Cara :)
---
View my Online Portfolio at:

http://www.onemodelplace.com/CaraQuinn

Follow me on Twitter!

https://twitter.com/ModelCara

---
Gamers mailing list __ [email protected]
If you want to leave the list, send E-mail to [email protected].
You can make changes or update your subscription via the web, at
http://audyssey.org/mailman/listinfo/gamers_audyssey.org.
All messages are archived and can be searched and read at
http://www.mail-archive.com/[email protected].
If you have any questions or concerns regarding the management of the list,
please send E-mail to [email protected].


---
Gamers mailing list __ [email protected]
If you want to leave the list, send E-mail to [email protected].
You can make changes or update your subscription via the web, at
http://audyssey.org/mailman/listinfo/gamers_audyssey.org.
All messages are archived and can be searched and read at
http://www.mail-archive.com/[email protected].
If you have any questions or concerns regarding the management of the list,
please send E-mail to [email protected].

Reply via email to