Login [Register]
Don't have an account? Register now to chat, post, use our tools, and much more.
This is an archived, read-only copy of the United-TI subforum , including posts and topic from May 2003 to April 2012. If you would like to discuss any of the topics in this forum, you can visit Cemetech's Your Projects subforum. Some of these topics may also be directly-linked to active Cemetech topics. If you are a Cemetech member with a linked United-TI account, you can link United-TI topics here with your current Cemetech topics.

This forum is locked: you cannot post, reply to, or edit topics. Sonic => Your Projects
United-TI Archives -> Sonic
 
    » Goto page Previous  1, 2
» View previous topic :: View next topic  
Author Message
John Barrus


Member


Joined: 25 May 2003
Posts: 131

Posted: 16 Jul 2003 01:05:19 pm    Post subject:

Collisions would be harder to detect than if this was an aligned map routine. Since the routine is smooth scrolling, what is on the screen isn't always an accurate representation of what the tile map is in relation to the pointer. (At most, it would be 7 pixels (bits) off). By providing some sort of offset to every sprite displayed on the screen, we can detect collisions.

I talked with Patrick D and others, they said that it would work. Just don't ask me how to do it, I haven't figured out yet.
Back to top
james


Member


Joined: 25 May 2003
Posts: 114

Posted: 17 Jul 2003 10:09:21 am    Post subject:

John- do u mind sending me something that u have done with the engine.
my email is in the sonic forum sdomewhere if u dont know it
Back to top
Tyler


Advanced Member


Joined: 29 May 2003
Posts: 352

Posted: 17 Jul 2003 10:59:55 am    Post subject:

Unless you made the sprites 8x8 or 16x16 and all the other sprites were 8x8 or 16x16, then you could just look at the array without any errors, right?
Back to top
Tyler


Advanced Member


Joined: 29 May 2003
Posts: 352

Posted: 17 Jul 2003 11:03:16 am    Post subject:

BTW - I have an example from MaxCoderz for along time ago to check the tile thats currently at x,y
Heres the code, I didn't write it! Someone from MaxCoderz did probably, but it wasn't me


Code:
;==========================================================
; mapGetTile(h=x,l=y)
;==========================================================
;returns value of (h,l) on map
;destroys de
mapGetTile:
   push hl
   push hl
   ld h,0
   add hl,hl
   add hl,hl
   add hl,hl
   add hl,hl
   add hl,hl
   add hl,hl
   add hl,hl;*128 (=mapWidth)
   pop de
   ld e,d
   ld d,0
   add hl,de
   ld de,(mapAdress)
   add hl,de

   ld a,(hl)
   pop hl
   ret

Theres also another nice package for screen scrolling things there. The only disadvantage is you'll have to impelment graystyle if you ever decide to use it. Tell me if you can't find it, it's something called 'FastMap'. It's exactly what you guys need and it even has smooth scrooling /w object detection! Smile
Back to top
John Barrus


Member


Joined: 25 May 2003
Posts: 131

Posted: 18 Jul 2003 12:18:59 am    Post subject:

James- I'll send you the source so far. Don't be to impressed. it's nothing. It just tests out the scrolling methods used, and it doesn't copy the next row-column in yet. I figure we have to write a whole new tilemap routine anyway, so I don't want to do anything more with the current source. I just wanted to see that I can do it.

Tyler- The sprites will be 8x8 and 16x16, but detecting collisions will be a little harder than using that gettile routine. As I said, we will have to use some sort of tile offsetting routine that will read from the map and then add an offset (depending on how far the screen is scrolled) to get the true position of the sprite relative to the screen.

I'm sure I'll probably look at the source of that Fastmap thing you speak of. It may prove handy. Smile
Back to top
james


Member


Joined: 25 May 2003
Posts: 114

Posted: 18 Jul 2003 05:02:16 pm    Post subject:

Ok john,i finally got to see what you have so far...and its great,i know you are still working with it,like the re drawing and also with the speed but its good.
keep up the good work Very Happy
the sprite u sent was good by the way
im going to show some more of what i have done in a little bit,dont expect anything to good
Back to top
John Barrus


Member


Joined: 25 May 2003
Posts: 131

Posted: 19 Jul 2003 04:26:53 am    Post subject:

Great. As I said, I'll write a whole new tile-map routine over the weekend, (it'll have support for any size of maps) and then I'll work on scrolling it. Hopefully it will be better than most of the stuff I've seen already.
Back to top
Display posts from previous:   
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
    » Goto page Previous  1, 2
» View previous topic :: View next topic  
Page 2 of 2 » All times are GMT - 5 Hours

 

Advertisement