STGraves Posted November 12, 2015 Share Posted November 12, 2015 I was thinking on creating a way to disable collision detection when a switch is activated and not only deactivate it but also changing the three-dimensional position of the character, in other words allowing it to pass behind the PF, but I honestly couldn't think of a functional way to do so, any ideas, or better yet, is it even possible? Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted November 12, 2015 Share Posted November 12, 2015 Have you looked at this yet: randomterrain.com/atari-2600-memories-batari-basic-commands.html#priority_example Quote Link to comment Share on other sites More sharing options...
STGraves Posted November 12, 2015 Author Share Posted November 12, 2015 Yes I have but I couldn't get it to work, no I didn't just paste it the exact same way as it's written. Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted November 12, 2015 Share Posted November 12, 2015 Does that program compile for you the way it is without making any changes? Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted November 13, 2015 Share Posted November 13, 2015 I updated that program so it might be less complicated. This flips the bit: _Bit2_Flip_CTRLPF{2} = !_Bit2_Flip_CTRLPF{2} This puts what you need in CTRLPF: temp5 = 1 : temp5{2} = _Bit2_Flip_CTRLPF{2} : CTRLPF = temp5 Remember that when you use the individual bits of a variable to do simple on/off jobs, you can no longer use the whole variable for other jobs. For example, if you use one of the bits of the variable a, you can't use something like a = 48 or a = a + 1 in your program somewhere else. If you do, the bit you are trying to use in the variable a will end up getting overwritten. Quote Link to comment Share on other sites More sharing options...
STGraves Posted November 14, 2015 Author Share Posted November 14, 2015 Sorry for answering this late yes it does compile perfectly and runs, but the function doesn't work, let me try the new version, thanks. Quote Link to comment Share on other sites More sharing options...
STGraves Posted November 14, 2015 Author Share Posted November 14, 2015 I have one question can the variable be used in a different bit than 2? Quote Link to comment Share on other sites More sharing options...
STGraves Posted November 14, 2015 Author Share Posted November 14, 2015 I see it can be done, now I wonder if it's possible to do it with switches instead of the fire button, because for some reason it crashes my game xD Quote Link to comment Share on other sites More sharing options...
STGraves Posted November 14, 2015 Author Share Posted November 14, 2015 I got it to compile without crashing, I'm not sure if it's because the collision detection but my character can't go underneath the PF, do you think it has to do with that? Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted November 15, 2015 Share Posted November 15, 2015 I got it to compile without crashing, I'm not sure if it's because the collision detection but my character can't go underneath the PF, do you think it has to do with that? Say you have something like this: dim _Bit2_Flip_CTRLPF = y _Bit2_Flip_CTRLPF{2} = !_Bit2_Flip_CTRLPF{2} temp5 = 1 : temp5{2} = _Bit2_Flip_CTRLPF{2} : CTRLPF = temp5 And you want to use bit 7 instead of bit 2. Just do this: dim _Bit7_Flip_CTRLPF = y _Bit7_Flip_CTRLPF{7} = !_Bit7_Flip_CTRLPF{7} temp5 = 1 : temp5{2} = _Bit7_Flip_CTRLPF{7} : CTRLPF = temp5 Do not change the "temp5{2}" part of the code. If you changed it, that would be why you are having a problem. Quote Link to comment Share on other sites More sharing options...
STGraves Posted November 15, 2015 Author Share Posted November 15, 2015 I think that's exactly the problem! I don't have my laptop here with me but I think I did changed the temporary bit to 5 Quote Link to comment Share on other sites More sharing options...
+Gemintronic Posted November 15, 2015 Share Posted November 15, 2015 I was thinking on creating a way to disable collision detection when a switch is activated and not only deactivate it but also changing the three-dimensional position of the character, in other words allowing it to pass behind the PF, but I honestly couldn't think of a functional way to do so, any ideas, or better yet, is it even possible? It sounds like you're limiting yourself to a modified collision detection example. If you're writing your own engine then you can simply use a flag to determine whether you run collision event code. if dontprocesscollision = 1 then goto nocollsions Quote Link to comment Share on other sites More sharing options...
STGraves Posted November 15, 2015 Author Share Posted November 15, 2015 That's an awesome idea but I have no variables left free, and I can't clean them, but I have a idea which involves restructuring the game. Quote Link to comment Share on other sites More sharing options...
+Gemintronic Posted November 15, 2015 Share Posted November 15, 2015 That's an awesome idea but I have no variables left free, and I can't clean them, but I have a idea which involves restructuring the game. I'd see what you can do using individual bits instead of whole variables. dim attributes = g def isnekkid=attributes{0} def victhere=attributes{1} def victdead=attributes{2} def gotmarla=attributes{3} def doorhere=attributes{4} def popohere=attributes{5} def ghostgone=attributes{6} def bulletsnow=attributes{7} if isnekkid then goto flashing Quote Link to comment Share on other sites More sharing options...
STGraves Posted November 15, 2015 Author Share Posted November 15, 2015 Wow I still have a lot to learn I didn't know about using def Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted November 15, 2015 Share Posted November 15, 2015 Wow I still have a lot to learn I didn't know about using def I had all kinds of mysterious problems when using def, so I stopped using it. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.