Jump to content
IGNORED

Creating a vector between two 'tiles'


PacManPlus

Recommended Posts

Hey guys:

 

I have an instance where lightning is going to come from off the top of the screen down to a pre-determined random point on the screen. Also, it is all going to be done with 'tiles' (i.e. no sprites). I've already limited the destination point to a tile interval, but what I'm trying to find is:

 

The X and Y interval to place the tiles from the very top of the screen where the lightning starts (a random X value, but Y is always zero) to the tile on the screen where the lightning is supposed to 'hit'.

 

I know that I should know this, but I can't think of the algorithm... :dunce:

Does anyone know?

 

Thanks,

Bob

Edited by PacManPlus
Link to comment
Share on other sites

Thanks!

 

Although Bresenham's line algorithm reminded me...

Now I actually feel even more ridiculous (if that's even possible) - as I forgot that I already asked this question when I was working on PinOut and Asteroids Deluxe :dunce:

 

... wow what's going on with my memory lately? :ponder:

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...