It is currently Fri Jul 20, 2018 9:48 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 1451 posts ]  Go to page Previous  1 ... 21, 22, 23, 24, 25, 26, 27 ... 97  Next
Author Message
 Post subject:
PostPosted: Mon Sep 19, 2011 10:28 am 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10612
Location: Rio de Janeiro - Brazil
I don't know why you absolutely need the wall to be 8 pixels thick, but I guess there are ways to work around this. Maybe you can find some other way to define the default collision type, so that instead of air it's water in this case.

Maybe you could have the default collision type be water or air depending on the index of the metatile, or the index of the palette used for the metatile, something like that.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 19, 2011 1:09 pm 
Offline
User avatar

Joined: Thu Apr 23, 2009 11:21 pm
Posts: 898
Location: cypress, texas
Ah, that is a ggrand (edit: I kind of had thought of something like that too. Thank you tokumaru for your challenges! :D) idea tokumaru! Ok this is what we decided... after much talking... that we would set bit 3 to 1 for default water and leave it at 0 for default air. And that will bring our total collision blocks down from 16 to 8... 8 is all we (edit: I remember saying this about the 4) need for this game. It's twice as much as 4! We realize we are throwing away 8... but my sister is estatic we can use 5! That leaves 3 more! :) :( :) :D Thank you tepples and tokumaru so much!! :D


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 19, 2011 3:08 pm 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10612
Location: Rio de Janeiro - Brazil
Heh, I was gonna suggest that but I thought you wouldn't want to give up half the collision types for this... Guess I was wrong! =)

This is what you are planning to do, right?

Code:
76543210
||||||||
|||||+++- Secondary collision type (solid, platform, danger, etc.);
||||+---- Primary collision type (0 = air, 1 = water);
|||+----- Primary or secondary collision for the top left tile;
||+------ Primary or secondary collision for the top right tile;
|+------- Primary or secondary collision for the bottom left tile;
+-------- Primary or secondary collision for the bottom right tile;


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 19, 2011 5:30 pm 
Offline
User avatar

Joined: Thu Apr 23, 2009 11:21 pm
Posts: 898
Location: cypress, texas
tokumaru wrote:
Heh, I was gonna suggest that but I thought you wouldn't want to give up half the collision types for this... Guess I was wrong! =)


Well, we talked for anothger extended time, cause I think that I'd have to set each metatile and, oooh foood is for eating now, no... I'd have to set each metatile and that would be crazy and would be much better for it to be set in the .chr file cause she is in charge of the graphics... and so it would be less work for me and we'd have a quicker game... that would be good. Food would be goood too! I'll reply to the rest of your reply in a bit. :)

tokumaru wrote:
This is what you are planning to do, right?

Code:
76543210
||||||||
|||||+++- Secondary collision type (solid, platform, danger, etc.);
||||+---- Primary collision type (0 = air, 1 = water);
|||+----- Primary or secondary collision for the top left tile;
||+------ Primary or secondary collision for the top right tile;
|+------- Primary or secondary collision for the bottom left tile;
+-------- Primary or secondary collision for the bottom right tile;


Ok, yes that is what we are planning to do, if
    "Primary or Secondary collision" can be false.
and
    Our efforts (below) don't make sense and cant work.


We decided to ask you: Could the last row of each .chr file determine if the default collision would be water? (Moving all water tiles to row F) so if the tile is F3 then it's water? Could that work? (I don't know what "index of the metatile" means. That was my guess...)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 20, 2011 7:39 am 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10612
Location: Rio de Janeiro - Brazil
unregistered wrote:
Could the last row of each .chr file determine if the default collision would be water? (Moving all water tiles to row F) so if the tile is F3 then it's water? Could that work? (I don't know what "index of the metatile" means. That was my guess...)

Yup, I suggested something like that. I'm usually against hardcoding logic decisions to visuals, but if done carefully it isn't necessarily bad.

Do you have only 1 water tile though? What about the water surface?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 21, 2011 7:09 am 
Offline
User avatar

Joined: Thu Apr 23, 2009 11:21 pm
Posts: 898
Location: cypress, texas
Well, yes, we have more than one water tiles... but they will all be moved to the last row of each .chr file.

Please explain "water surface". :?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 21, 2011 7:22 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 20280
Location: NE Indiana, USA (NTSC)
In SMB1 maps, look at 2-2. The top row of water tiles uses a different tile from the rest. Then look at 3-1 and see the bridge about a third of the way through: the top tile is different. And any x-4 level uses that same top-of-water-area tile for its boiling Kool-Aid. This tile is used at the water surface.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 21, 2011 7:49 am 
Offline
User avatar

Joined: Thu Apr 23, 2009 11:21 pm
Posts: 898
Location: cypress, texas
Ah, I understand now. Thanks. :D Hahaha, boiling Kool-Aid.
We do have water surface tiles. They are inccluded in the water tiles. :)


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 24, 2011 5:01 pm 
Offline
User avatar

Joined: Thu Apr 23, 2009 11:21 pm
Posts: 898
Location: cypress, texas
This question is about if, elseif, else, and endif from asm6

Code:
0C2E6 B1 10                     --   lda ($10),y
0C2E8 8D D0 C2                      sta currenttile
0C2EB                                if ((currenttile > 15) && (currenttile < 32)) ; is solid
0C2EB                                   lda #00000001b
0C2EB                                  
0C2EB                                  elseif (currenttile > 239) ; is water
0C2EB A9 03                             lda #11b
0C2ED                                  
0C2ED                                 else ;(a) is empty
0C2ED                                    lda #00000000b
0C2ED                                   endif
0C2ED                                 
0C2ED AE CF C2                        ldx rowPointer
0C2F0 9D 8E C2                         sta firstRow,x
0C2F3                              
0C2F3                              
0C2F3 E8                           inx ;increment pointer used with firstRow
0C2F4 8E CF C2                     stx rowPointer
0C2F7 C8                           iny
0C2F8 D0 EC                       bne --


This is from my listing file .lst.
I have tried these statements with $0F hex numbers and then changed the hex to decimal. Only the middle lda #11b has hex codes on the left side. Why? :? My problem is that I tried to use assembler directives as c++ statements... I think.? :?: :?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 24, 2011 5:16 pm 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10612
Location: Rio de Janeiro - Brazil
Assembler directives can't be used for game logic. These expressions are evaluated when the program is assembled, not when the program runs.

EDIT: Let me try to explain what happened there: currenttile is a label that points to a RAM location, and this location is probably after address 239, which is why lda #11b got assembled.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 24, 2011 5:30 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 20280
Location: NE Indiana, USA (NTSC)
If you want C, you know where to find it: Alter Ego by Shiru.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 24, 2011 6:29 pm 
Offline
User avatar

Joined: Thu Apr 23, 2009 11:21 pm
Posts: 898
Location: cypress, texas
Thanks tokumaru! :D It's good to ask a question; thank you God. :)

tepples wrote:
If you want C, you know where to find it: Alter Ego by Shiru.

:?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 28, 2011 2:49 pm 
Offline
User avatar

Joined: Thu Apr 23, 2009 11:21 pm
Posts: 898
Location: cypress, texas
A useful property of CMP is that it performs an equality comparison and an unsigned comparison. After a CMP, the Z flag contains the equality comparison result and the C flag contains the unsigned comparison result, specifically:
Quote:
If the Z flag is 0, then A <> NUM and BNE will branch
If the Z flag is 1, then A = NUM and BEQ will branch
If the C flag is 0, then A (unsigned) < NUM (unsigned) and BCC will branch
If the C flag is 1, then A (unsigned) >= NUM (unsigned) and BCS will branch

So if A < NUM then BCS will not branch, right?
I want to branch if A is not < NUM. I'm kindof confused about this; could you help? :?

Quote:
In fact, many 6502 assemblers will allow BLT (Branch on Less Than) and BGE (Branch on Greater than or Equal) to be used as synonyms for BCC and BCS, respectively.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 28, 2011 2:55 pm 
Offline
Formerly 65024U

Joined: Sat Mar 27, 2010 12:57 pm
Posts: 2261
http://www.obelisk.demon.co.uk/6502/reference.html#CMP

If A<ComparedTo, then C=0, BCC taken.
If A>=ComparedTo, then C=1, BCS taken.

And yeah, the opposite branches for each taken will not be taken.

And to branch if a number is greater than A, do:

Code:
CMP #$20
BCS Somewhere ;BCS is taken because A is bigger or equal to #$20.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 28, 2011 3:45 pm 
Offline
User avatar

Joined: Thu Apr 23, 2009 11:21 pm
Posts: 898
Location: cypress, texas
If A is not less than NUM then it must be equal to or greater than NUM. :D


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1451 posts ]  Go to page Previous  1 ... 21, 22, 23, 24, 25, 26, 27 ... 97  Next

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group