Conveyor belt tiles...

darkhog

New member
So I'm working on a conveyor belt tile and here's the current code:

Code:
;conveyor belt - left
;pushing accumulator to the stack to avoid memory corruption just in case
pha
CPX player1_object
BNE notPlayerConvL
LDA Object_h_speed_hi,x
SEC
SBC #$01
STA Object_h_speed_hi,x
notPlayerConvL:
;pulling back the acc.
pla

and I'm kinda stumped - it shoots the player like a cannon, instead of a steady movement. I know that the problem is that I change the speed based on previous speed, but if I'd just rigidly set it, the player wouldn't be able to move in order to beat the conveyor/move faster along it. Any ideas?
 

jorotroid

Member
I think you are sort of thinking about it backwards. Try starting with a speed in mind for the conveyor to move the player at, then add/subtract the player's current speed to that.
 

darkhog

New member
Hey, thank you! Will try that! Probably will work.

If it'll work, I'll post code for left conveyor and right conveyor belt along with instructions on how to use.
 

darkhog

New member
Yeah, already saw that.
Code:
;conveyor belt - left
;pushing accumulator to the stack to avoid memory corruption just in case
pha
CPX player1_object
BNE notPlayerConvL
LDA #00
SEC
SBC #$06
ADC Object_h_speed_hi,x
STA Object_h_speed_hi,x
notPlayerConvL:
;pulling back the acc.
pla
 

jorotroid

Member
I'm not sure if there is an elegant way to do it. What you need is access to the ObjectMaxSpeed value, but that is on a different bank than the Tile Collision routines. One way to go about it is to have being on a conveyor flip a flag and then in the Physics_Platform_Simple code do something similar to how sprinting works expect instead of being activated by a button, it's activated by the flag. Not sure if that's the best way of doing it.
 

Pauldalyjr

Active member
Change the h speed to low, i think this is the result you are looking for.
Code:
 ;conveyor belt - left
;pushing accumulator to the stack to avoid memory corruption just in case
pha
CPX player1_object
BNE notPlayerConvL
LDA Object_h_speed_lo,x
SEC
SBC #$01
STA Object_h_speed_lo,x
notPlayerConvL:
;pulling back the acc.
pla
 

Pauldalyjr

Active member
This tile type can be manipulated into so many variations. play with the speeds...
Slowly fall through a tile
Code:
pha
CPX player1_object
BNE notPlayerSlowFall
LDA Object_v_speed_hi,x
SEC
SBC  #$01
STA Object_v_speed_lo,x
notPlayerSlowFall:
pla
Rocket Upwards
Code:
pha
CPX player1_object
BNE notPlayerCannon
LDA Object_v_speed_hi,x
SEC
SBC  #$01
STA Object_v_speed_hi,x
notPlayerCannon:
pla
There is so much that can be done by altering the Horizontal and Vertical code. You can make mega man like fans, quicksand, walls that allow you to bounce off of them, all kinds of crazy creative stuff.
 

TolerantX

Active member
Is there a way to have these tiles ignore a check for overhead collision so we could pass through when we jump up from underneath? If so where is a good place to start?
 
TolerantX said:
Is there a way to have these tiles ignore a check for overhead collision so we could pass through when we jump up from underneath? If so where is a good place to start?

Use the fix for oneway tiles and place it at the start of thd conveyor code , that would be a place to start
But im interested in making it quicksand
 
Top Bottom