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
»
Axe
(Moderator:
Runer112
) »
Never got around to asking :P
« previous
next »
Print
Pages: [
1
]
Go Down
Author
Topic: Never got around to asking :P (Read 2777 times)
0 Members and 1 Guest are viewing this topic.
hellninjas
LV7
Elite (Next: 700)
Posts: 625
Rating: +17/-0
Never got around to asking :P
«
on:
May 31, 2012, 11:15:00 am »
How would I use the pxl-test( command to prevent my character from falling through pixels, with acceleration of course, x256.
Or is there another, possibly easy, way to do this?
Logged
Happybobjr
James Oldiges
LV11
Super Veteran (Next: 3000)
Posts: 2325
Rating: +128/-20
Howdy :)
Re: Never got around to asking :P
«
Reply #1 on:
May 31, 2012, 11:37:39 am »
uhh, divide by 256 to snap to a pixel.
From there, before you draw anything but the ground or solid platforms, use pxl-test(x,y+#) the plus number will be different depending on the height of your sprite. 0 means no pixel there, 1 means pixel there
Logged
School: East Central High School
Axe: 1.0.0
TI-84 +SE ||| OS: 2.53 MP (patched) ||| Version: "M"
TI-Nspire ||| Lent out, and never returned
____________________________________________________________
hellninjas
LV7
Elite (Next: 700)
Posts: 625
Rating: +17/-0
Re: Never got around to asking :P
«
Reply #2 on:
May 31, 2012, 11:44:34 am »
So..
Code:
[Select]
:If getKey(1) and (pxl-test(X/256,Y/256+4)=0)
Logged
Happybobjr
James Oldiges
LV11
Super Veteran (Next: 3000)
Posts: 2325
Rating: +128/-20
Howdy :)
Re: Never got around to asking :P
«
Reply #3 on:
May 31, 2012, 11:53:14 am »
probably not. You said there is acceleration, which adds another dimension into it.
try...
:If getKey(1)
:*calculations in movement and stored to another variable, such as Z, as would be resulting location*
:If pxl-test(X/256,Z/256+4)=0
:Z->Y
:else
:Z + 256 -> Y
:end
:end
Try that.
you my need to change it to be relevant to your code.
Edit: added an example program.
«
Last Edit: May 31, 2012, 12:50:24 pm by Happybobjr
»
Logged
School: East Central High School
Axe: 1.0.0
TI-84 +SE ||| OS: 2.53 MP (patched) ||| Version: "M"
TI-Nspire ||| Lent out, and never returned
____________________________________________________________
Print
Pages: [
1
]
Go Up
« previous
next »
Omnimaga
»
Forum
»
Calculator Community
»
TI Calculators
»
Axe
(Moderator:
Runer112
) »
Never got around to asking :P