Download Resources Web Applications Games Recycle Bin

portals | gml



Add new objects objPortalA and objPortalB 20px width x 64px height:



objPlayer Alarm → Alarm 9

/// @description Portal Cooldown
exit

objPortalA Collision event with objPlayer

if (objPlayer.alarm[9] < 1){
	objPlayer.alarm[9] = 30;
	objPlayer.y = objPortalB.y; 
	var side_facing = objPlayer.x-objPlayer.xprevious;
	objPlayer.x = objPortalB.x + side_facing;
}

objPortalB Collision event with objPlayer

if (objPlayer.alarm[9] < 1){
	objPlayer.alarm[9] = 30;
	objPlayer.y = objPortalA.y; 
	var side_facing = objPlayer.x-objPlayer.xprevious;
	objPlayer.x = objPortalA.x + side_facing;
}

Challenge:

1. Implement the above code.

2. CHALLENGE try making an "invisible portal". This is like a hidden portal that is a bonus for the player to find.

3. CHALLENGE if you can find the invisible portal, make it visible once found.

4. Find a cool, possibly animated sprite or appearance for your "portal".

5. Vertical portals... very difficult!