Author Topic: Hit detection with xlib  (Read 5600 times)

0 Members and 2 Guests are viewing this topic.

Offline tifreak

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2708
  • Rating: +82/-3
  • My Kung Fu IS strong...
    • View Profile
    • TI-Freakware
Hit detection with xlib
« Reply #15 on: January 16, 2007, 02:25:00 am »
I think you would be better off having other variables represent the x and y, and get rid of the /8 for each. When the character moves, just update the variables. This way, it will not error out when it moves around the screen. :)smile.gif
Projects: AOD Series: 75% | FFME: 80% | Pokemon: 18% | RPGSK: 60% | Star Trek: 70% | Star Trek 83+: 40% | TI-City: 5%

xiaden

  • Guest
Hit detection with xlib
« Reply #16 on: October 30, 2007, 06:40:00 am »
If it doesn't work when you are at location 0,0 thats because there is no 0 in a matrix.  your map is also offset in the topleft direction by one tile, right? i would just change your formula to:
c1-->
CODE
ec1if [a](Y/8+1,X/8+1) = ... whatever you had here..c2
ec2
that should fix it, and your map might get a lill bigger =P it you get errors on the outer edges now, thats because your matrixes arn't the same size.