×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Problem with Lingo

Problem with Lingo

Problem with Lingo

(OP)
Hi all,

I have written a simple game in Lingo using Macromedia Director 2004 MX. So far I have designed a character which moves by pressing arrow keys. Also, I have used this technic to move background instead my character. In other words, I move bacckground to right, left, up and down to show my character is moving within a square frame. Now the problem is that I want to change the game, so when the character is at the end of a way, my frame stops. Right now, when my character reachs end of a way the frame still moves to the empty (black background) place but I want to make it stop however the user is pressing the arrow key. Can anybody help about this?

Regards,

Danesh

RE: Problem with Lingo


While moving the background image instead of the player is a good idea, you may need to find a better method (for example, what happens when you have enemies moving round the level too?)

The method I would use would be to store the player's 'h' and 'v' position in variables (properties), and when the player moves, adjust these h and v variables, and not the sprite's h and v position.

Then, you can calculate where the player's sprite should be displayed, by adding his 'h' and 'v' variables, to the top-left position of your background image.

This way, you can then move your background image so that the player stays roughly in the middle of the screen, but in your programming, your code is 'theorectically' moving the player instead of the background. This will make it much easier for you to move on to your current problem which is the collision detection.

There are a lot of ways to approach this (collision detection), it's really a very large area and probably can't be answered as a single question. Instead I would advise that you do some google searches for phrases like:

"2d collision detection"
"tile based collision detection"
"lingo collision detection"

And read around the subject that you are tackling. You'll find there are many different methods available, and you'll have to decide which method suits the kind of game you are making.

hope this helps!

- Ben


Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close