Moving Platform Objects

User avatar
dale_coop
Posts: 1294
Joined: Fri Feb 16, 2018 7:05 am
Location: France

Re: Moving Platform Objects

Post by dale_coop » Sun Sep 02, 2018 2:24 pm

Yes. I use a lot those values too for my “special” game objects that have different behaviors.
-----
Sorry about my poor english
All I need: A Damn Fine Cup of Coffee
My games: PRESS START GAME / UNDERGROUND ADVENTURE
User avatar
WolfMerrik
Posts: 199
Joined: Sat Aug 11, 2018 4:59 pm
Location: Maine
Contact:

Re: Moving Platform Objects

Post by WolfMerrik » Sun Sep 02, 2018 7:10 pm

Finally... A Bit more progress

Image


So, After detecting that the entity does indeed have the platformer flag, checked for in playerWasNotHurtDuringCollision:

Code: Select all

	AND #%01000000
	BNE solidMovingPlatform
Then we add this somewhere:

Code: Select all

solidMovingPlatform: ; It is a solid moving platform...

	LDX player1_object
	;LDA ObjectHeight,X
	LDA selfCenterY		; I took this  from the jump on enemy code...
	;ADC #$02		; I am not sure if that is really doing much lol, its still hard to tell
	CMP otherCenterY
	BCS dontJumpOnPlatform
	
	LDA Object_y_hi,y	; This is an attempt to make the player be ON TOP
	STA Object_y_lo,x	; Of the platform object.... it does not work correctly

	LDA Object_status,x
	ORA #%00000100
	STA Object_status,x
	LDA Object_movement,x	
	AND #%00001111
	STA Object_movement,x
	JMP AboveIsSolid	; Go to the collision code for the one way plat...
All of these changes were added to HandleObjectCollisions_Platform_Simple.asm

I have tried adding code to try to make the player move WITH the platform, like so:

Code: Select all

	LDA Object_h_speed_lo,x
	SEC
	ADC Object_h_speed_lo,y
	SEC
	STA Object_h_speed_lo,x
But it has STRANGE results... I do not think I am doing this ANYWHERE near correctly.
Sadly, I have to go to work now, just after having a small breakthrough.

Hopefully though, with a bit more work, and research as to the what the values I am changing actually DO,
This will work as inteded soon!
ImageWant to download & share Image NESMaker Resources? Check out My Files on www.NESMakerFiles.com Image
User avatar
WolfMerrik
Posts: 199
Joined: Sat Aug 11, 2018 4:59 pm
Location: Maine
Contact:

Re: Moving Platform Objects

Post by WolfMerrik » Sun Sep 02, 2018 8:06 pm

I honestly must say,
Being on the BUS on my way to work has given me a lot of ideas on how to get this to work even better!

If I can figure out how to add an objects speed to another (both vert, and horizontal),
This platform script COULD work for 4 directional platforms, which means it could work with lifts as well.

Combine that with a tile that triggers it to change direction, and this could really work great!

Also, setting it so the players bottom is on the top of the object is KEY to this working correctly.
ImageWant to download & share Image NESMaker Resources? Check out My Files on www.NESMakerFiles.com Image
User avatar
Convoy_Avenger
Posts: 63
Joined: Tue Aug 14, 2018 1:42 am

Re: Moving Platform Objects

Post by Convoy_Avenger » Mon Sep 03, 2018 12:54 am

A lot of great work so far Wolf.
User avatar
WolfMerrik
Posts: 199
Joined: Sat Aug 11, 2018 4:59 pm
Location: Maine
Contact:

Re: Moving Platform Objects

Post by WolfMerrik » Mon Sep 03, 2018 4:07 am

Convoy_Avenger wrote:
Mon Sep 03, 2018 12:54 am
A lot of great work so far Wolf.
Thanks man!

After just getting home from work, and trying some of the ideas I came up with, I not only got it working, but made a script that lets you jump down from one way platform tiles,
The result is as follows:

Image

I am working on commenting it, removing redundant code, and finding a way that I can make this be easily included in others projects!
ImageWant to download & share Image NESMaker Resources? Check out My Files on www.NESMakerFiles.com Image
User avatar
dale_coop
Posts: 1294
Joined: Fri Feb 16, 2018 7:05 am
Location: France

Re: Moving Platform Objects

Post by dale_coop » Mon Sep 03, 2018 9:53 am

Congrats WolfMerrik.
Looks great.
-----
Sorry about my poor english
All I need: A Damn Fine Cup of Coffee
My games: PRESS START GAME / UNDERGROUND ADVENTURE
User avatar
WolfMerrik
Posts: 199
Joined: Sat Aug 11, 2018 4:59 pm
Location: Maine
Contact:

Re: Moving Platform Objects

Post by WolfMerrik » Mon Sep 03, 2018 1:06 pm

dale_coop wrote:
Mon Sep 03, 2018 9:53 am
Congrats WolfMerrik.
Looks great.
Thanks man! It is still VERY buggy, and only really works part of the time, But another day or so, it should be solid! (pun intended)

I also, for the life of me, cannot get ANYTHING, monsters, game objects, etc, to move Up and Down, only Left and Right. Even with ignore gravity. No idea why!
Do you know what might be causing this?

I am assuming it has to do with "ignore gravity", but cant find why
ImageWant to download & share Image NESMaker Resources? Check out My Files on www.NESMakerFiles.com Image
User avatar
dale_coop
Posts: 1294
Joined: Fri Feb 16, 2018 7:05 am
Location: France

Re: Moving Platform Objects

Post by dale_coop » Mon Sep 03, 2018 2:47 pm

WolfMerrik wrote:
Mon Sep 03, 2018 1:06 pm
I also, for the life of me, cannot get ANYTHING, monsters, game objects, etc, to move Up and Down, only Left and Right. Even with ignore gravity. No idea why!
Do you know what might be causing this?
I am assuming it has to do with "ignore gravity", but cant find why
I am not sure... don't think ignore gravity disable vertical movenents. Should be someting else. If I had some time, I would dig in that...
But recently I didn't have time to tests anything (or only a few of the scripts available here on the forum). Busy life.

I think in the platform engine... vertical movements is alowed by :
- jumps
- onladder
I think you could find inspirations with those functionalities (jump scripts... or using onLadder set to #$01 should do the trick :p for up and down. But then you need to find a way to put back to #$00)
-----
Sorry about my poor english
All I need: A Damn Fine Cup of Coffee
My games: PRESS START GAME / UNDERGROUND ADVENTURE
User avatar
WolfMerrik
Posts: 199
Joined: Sat Aug 11, 2018 4:59 pm
Location: Maine
Contact:

Re: Moving Platform Objects

Post by WolfMerrik » Mon Sep 03, 2018 3:26 pm

dale_coop wrote:
Mon Sep 03, 2018 2:47 pm
- onladder
I think you could find inspirations with those functionalities (jump scripts... or using onLadder set to #$01 should do the trick :p for up and down. But then you need to find a way to put back to #$00)
I looked at that, although I would like to be able to do this for enemies as well. Particularly the "ignore gravity" flag, seems to just ignore vertical movement lol.

For the player, I think I have a workaround, if I can just get the enemy to move up and down lol
ImageWant to download & share Image NESMaker Resources? Check out My Files on www.NESMakerFiles.com Image
User avatar
Craigery
Posts: 21
Joined: Mon Apr 30, 2018 8:53 pm

Re: Moving Platform Objects

Post by Craigery » Mon Sep 03, 2018 3:38 pm

Just gotta say this is absolutely amazing! :shock:
Post Reply