Actor collision detection with offset hitboxes #96
			No reviewers
			
				
				
			
		
		
		
	
	
	
		Labels
		
	
	
	
	No labels
	
		
			
	
	bug
		
			doodad
		
			enhancement
		
			levels & doodads
		
			security
		
			ui toolkit
		
			wontfix
		
		
	
		No milestone
		
			
		
	
	No project
	
		
	
	
	
	
		No assignees
		
	
	
		
			
		
	
	
	
		1 participant
	
	
		
		
	Notifications
	
		
	
	
	
		
	
	
	Due date
No due date set.
	
		Dependencies
		
		
	
	
	No dependencies set.
		Reference: SketchyMaze/doodle#96
		
	
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	
	No description provided.
		
		Delete branch "actor-collision"
	
	Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This branch attempts to fix actor collision hitboxes when their hitbox is "offset" away from the 0,0 top left coordinate.
Most of the built-in doodads have hitboxes anchored at 0,0 but some (like the Snake and Crusher) are offset - if playing as them, collision bugs may cause clipping through floors or not activating buttons correctly.
Some issues remaining:
373028a166Play as Boy:
Play as Mario (0,32,32,32):
Clean up and improve the between-actors collision code: * Give names to the A, B tuples from BetweenBoxes and call them the stable and mover doodads. All ops are from the perspective of the stable (A) box in relation to the mover (B). * Replace the map[*Actor]*Actor collision struct to one that supports arrays of colliding actors, enabling one actor to post OnLeave events correctly when it overlapped several actors at once. * Possibly improve on some of the collision bugs along the way. Some issues remaining: * If playing AS an offset-hitbox character: * Solid hitboxes against closed doors and platforms works OK. * Button InHitbox (overlap) checks do not fire (buttons won't press). * If playing with a non-offset character (e.g. boy.doodad) * Solid hitboxes work and Buttons will press correctly. * Both types of player hitboxes: * When touching a static object such as the Start Flag which has an offset hitbox of its own: the Start Flag will creep up the level on its Y axis when touched before it settles and won't move.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.