Skip navigation
NintendoAge
Welcome, Guest! Please Login or Join
Loading...

Mutiply by 32 / Calc tile pos Mutiply by 32 / Calc tile pos

LOCKED TOPIC

Oct 29, 2015 at 3:41:02 PM
sempressimo (0)
avatar
< Cherub >
Posts: 20 - Joined: 08/01/2015
Profile
Hi, this is my code for determining the tile (8x8 pixels) the player is on. Basically what I am trying to do is (x + y * 32), so that later I can look it up in the tiles array (.db)

I am not sure if ASL (five times would be the same as * 32).

CalcTargetTileNumber:

  LDA player_tile_y
  ASL A ; multiple by 32?
  ASL A
  ASL A
  ASL A
  ASL A
  CLC
  ADC player_tile_x_w
  STA target_tile_number

  RTS

Oct 29, 2015 at 4:34:48 PM
KHAN Games (89)
avatar
(Kevin Hanley) < Master Higgins >
Posts: 8126 - Joined: 06/21/2007
Florida
Profile
This is your second third! thread with a specific programming question. This is exactly why I made this thread right here:

http://nintendoage.com/forum/mess...

Please start using it and not using individual threads for each question. This will allow us to better keep things organized.

Thank you.

-------------------------

gauauu: look, we all paid $10K at some point in our lives for the privilege of hanging out with Kevin



Edited: 10/29/2015 at 04:36 PM by KHAN Games