Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email
?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Home
About
Team
Rules
Stats
Status
Sitemap
Chat
Downloads
Forum
News
Our Projects
Major Community Projects
Recent Posts
Unread Posts
Replies
Tools
SourceCoder3
Other Things...
Omnimaga Radio
TI-83 Plus ASM File Unsquisher
Z80 Conversion Tools
IES TI File Editor
Free RAM areas
Comprehensive Getkeyr table
URL Shortener
Online Axe Tilemap Editor
Help
Contact Us
Change Request
Report Issue/Bug
Team
Articles
Members
View the memberlist
Search For Members
Buddies
Login
Register
Omnimaga
»
Forum
»
Calculator Community
»
TI Calculators
»
TI-BASIC
»
Hit detection with xlib
« previous
next »
Print
Pages: [
1
]
2
Go Down
Author
Topic: Hit detection with xlib (Read 5599 times)
0 Members and 1 Guest are viewing this topic.
SuperSmashcz
Guest
Hit detection with xlib
«
on:
December 19, 2006, 09:04:00 am »
Ok, im very very VERY new at xlib, and ive done all the tutorials, and i understnad how they work, ect..
But now id like to know how to do a hit detection with xlib
anyone point me in the right direction?
Also, ive been re reading the tutorial, and it saids we can only use 8X8 sprites? What? So i cant use a 16X16?
P.S. Don't double post unless it is to bump or for other sensible reasons
Logged
Speler
LV8
Addict (Next: 1000)
Posts: 857
Rating: +6/-2
Hit detection with xlib
«
Reply #1 on:
December 19, 2006, 09:40:00 am »
Use edit button rather then double post. Wait a little and someone who uses xlib will answer.
Logged
Floodkiller
Guest
Hit detection with xlib
«
Reply #2 on:
December 19, 2006, 11:06:00 am »
1) Hit detection is what you make it. If you know how to do matrix hit detection, you know how to do a basic hit detection in xlib. Anything more complicated I haven't figured out yet, since my games haven't gotten to the point where I need a complicated hit detection.
2) You can use 16x16, just read the txt file with the xlib download in order to find out how to use each in your real( commands.
Logged
SuperSmashcz
Guest
Hit detection with xlib
«
Reply #3 on:
December 19, 2006, 12:06:00 pm »
The problem is idk how to do a matrix hit detection..
All i want is a basic wall hit detection..
Logged
dinhotheone
LV6
Super Member (Next: 500)
Posts: 410
Rating: +2/-1
Hit detection with xlib
«
Reply #4 on:
December 19, 2006, 12:07:00 pm »
i belive the manual says the sprites must have width of multiples of 8, so 16 is definitely fine, you only have to write 2 for sprite width instead of 1 (along with 16 in height not
Logged
SuperSmashcz
Guest
Hit detection with xlib
«
Reply #5 on:
December 19, 2006, 12:08:00 pm »
Oh ok, *hits self* didnt think of that one
Logged
Speler
LV8
Addict (Next: 1000)
Posts: 857
Rating: +6/-2
Hit detection with xlib
«
Reply #6 on:
December 19, 2006, 03:19:00 pm »
*
Super Speler
Logged
necro
LV9
Veteran (Next: 1337)
Posts: 1295
Rating: +17/-2
+3 vaporal mustache
Hit detection with xlib
«
Reply #7 on:
December 19, 2006, 06:37:00 pm »
@SuperSmashcz: please try to put a bit more content into each post...like when you said you got it, explain the method you now "get" in case it might help any other member in the future
@super speler:why not just merge the posts like I did?
Matrices can be used for a lot of complex tricks and as you can store several digits in a matrix in decimal (which xlib will ignore) you can store wether something is for instance a floor, wall, teleport, etc. You could then retrive this data through a series of rounding methods...but this can get slow.
And out of couriosity, is this forum actualy for xlib related coding advice/help?
Logged
I'm like a woot burger with awesome fries
VB.Net, C#, C++, Java, Game Maker
SuperSmashcz
Guest
Hit detection with xlib
«
Reply #8 on:
December 21, 2006, 12:45:00 pm »
Ok, apperently i didnt "got it"
ive got all the map data in a matrix,im using xlib, if that helps, but ive got 0 as wall, and 2 as a walkable tile, im using 16X16 sprites, basicaly giant squares, the method for detection is using
If[A](A+X+1,B+X+1) =2 : then
does movement code
i cant understand whats wrong, the problem is on the left and bottem sides of the screen, the sprite can go into the wall sprite "half way", where on the left and top, it stops just before hitting the sprite. realy confusing, let me kno if u need more code.
Logged
Floodkiller
Guest
Hit detection with xlib
«
Reply #9 on:
December 22, 2006, 03:51:00 am »
Well, if it hits it halfway, then either something is wrong with your displaying techniques, collision checks, or scrolling. In my game, it was the scrolling, because the formula wasn't put together correctly and pushed the character 1 square ahead of the matrix's hit detection. It was a simple fix (add one to the subtracted variable), but back to your problem. I would need more code from you, or I can't tell specifically what it is.
Logged
dinhotheone
LV6
Super Member (Next: 500)
Posts: 410
Rating: +2/-1
Hit detection with xlib
«
Reply #10 on:
December 22, 2006, 01:42:00 pm »
going halfway in is odd... the most plausible thing would be some mixup between bit numbers, like your scrolling an 8*8 char using a 16x16 tile map or something. code would defenitely be useful though
Edit: just thought of some stuff... one thing that may be wrong is the fact that x and y on the matrix corrospond to the top left spot on the screen. so when you are calculating what spot you are on you have to subtract one from x and y when you add screen location coordinates with regular position coordinates. another thing that might be a problem is that if you are using smooth movent instead of jump movement (moving a pixel at a time instead a tile at a time) you have to check for hit detection on every corner of the sprite.
Logged
Shazane Koronova
Guest
Hit detection with xlib
«
Reply #11 on:
January 15, 2007, 08:37:00 am »
I too have a problem with collision detection.
this is my code, X and Y are the coordinates of the sprite and are always multiples of 8:
c1-->
CODE
ec1
If [A](X/8,Y/8)=0
c2
ec2
in most places I get an invalid dimension error, and where I don't get that it just doesn't detect the collision and overwrites the tile.
Logged
tifreak
LV11
Super Veteran (Next: 3000)
Posts: 2708
Rating: +82/-3
My Kung Fu IS strong...
Hit detection with xlib
«
Reply #12 on:
January 15, 2007, 08:45:00 am »
http://tifreakware.net/tutorials/83p/b/tifw/les8.htm
That tutorial explains hit detection using matrices, lists and strings. Not the greatest in the world, but it should help you out with learning how to create a good, simple hit detection routine...
Logged
Projects: AOD Series: 75% | FFME: 80% | Pokemon: 18% | RPGSK: 60% | Star Trek: 70% | Star Trek 83+: 40% | TI-City: 5%
necro
LV9
Veteran (Next: 1337)
Posts: 1295
Rating: +17/-2
+3 vaporal mustache
Hit detection with xlib
«
Reply #13 on:
January 15, 2007, 08:49:00 am »
yeah, would need to show more more code like how the player's drawing code works to be sure, but I think you need to swich the x and y in your case.
Logged
I'm like a woot burger with awesome fries
VB.Net, C#, C++, Java, Game Maker
Shazane Koronova
Guest
Hit detection with xlib
«
Reply #14 on:
January 15, 2007, 09:06:00 am »
QUOTE
Logged
Print
Pages: [
1
]
2
Go Up
« previous
next »
Omnimaga
»
Forum
»
Calculator Community
»
TI Calculators
»
TI-BASIC
»
Hit detection with xlib