http://calcg.org/newlogo2.png Not Logged in.
Login | Register

General Discussion Board \ Calculator Discussion \ ASM Routine

Click here to log in (you must be logged in to post comments).

AuthorComment
alex10819
Wraith
Posted: 4 Apr 2005
13:54 GMT
Total Posts: 507
im just wondering, could an ASM routine be written to detect the collision of two sprites being controlled by a BASIC program? and if so, could someone make one for me? not much payoff, but i might let you see the finished product before anyone else (this is Phoenix Basic im talking about here)...

if someone could do this for me, i think i could chop off almost a third of the lag...
korkow
Ultralisk
Posted: 4 Apr 2005
15:28 GMT
Total Posts: 465
You could simply use the command "Px-Test"
threefingeredguy
Ghost
avatar
Posted: 4 Apr 2005
17:08 GMT
Total Posts: 1189
collision detection on a 8x8 grid or do they move freely?

and ill try to write it if you tell me what variables you have each sprites x and y coords in.

---
Someone call for an exterminator?
Lunchbox
Carrier
avatar
Posted: 4 Apr 2005
17:58 GMT
Total Posts: 2007
I can do it real easily and output it into any variable you want (1 for hit and 0 for clear, or something). Especially if you're using the 6x8 font set. Just tell me what the inputs are.
alex10819
Wraith
Posted: 6 Apr 2005
13:11 GMT
Total Posts: 507
heh... in using Codex so i have actual 8x8 sprites...

and i know i could use pixel test, but that means i need another if:then not to mention the PixelTest... also, Pixel test only tests one point at a time, i need to test the entire sprite for collisions...

im also seeing if Cemetech has any ideas...
Lunchbox
Carrier
avatar
Posted: 6 Apr 2005
18:05 GMT
Total Posts: 2007
Geez, 8x8 is even easier (At least for me :) )
alex10819
Wraith
Posted: 7 Apr 2005
13:36 GMT
Total Posts: 507
cool... and this can be called from basic?
TI Freak
Probe
Posted: 7 Apr 2005
14:16 GMT
Total Posts:

Edit
Well, it might be capable to do so through the use of a string, though I can't even begin to guess at the lag time it would cause for moving enemies of a full grid. By the time you get down to a couple enemies, it wouldn't be too bad...

[Edited by TI Freak on 07-Apr-05 23:16]
alex10819
Wraith
Posted: 7 Apr 2005
14:21 GMT
Total Posts: 507
i think what i will do is put it inside my For loop that moves the shots currently on screen.

{L4(M),L4(N),L3(1),L3(2)}:Asm(whatever)

this could detect whether the sprites were touching (thank TI for the ans variable...)

M is the address in list 4 of the X-coord of the shot, N is the address of the Y-Coord... (in case you were wondering)
Lunchbox
Carrier
avatar
Posted: 7 Apr 2005
22:04 GMT
Total Posts: 2007
Yes, it could be called from within a basic program.
alex10819
Wraith
Posted: 8 Apr 2005
15:32 GMT
Total Posts: 507
good... thats the sort of thing i need...





Portal | My Account | Register | Lost Password or Username | TOS | Disclaimer | Help | Site Search | File Archives Copyright © 2002-2019 CalcG.org