Jump to content
A 2021 backup has been restored. Forums are closed and work in progress. Join our Discord server for more updates! ×
SoaH City Message Board

[MMF2.0] Nitemare's PixelMov Engine Help..


marco

Recommended Posts

Well, checkpoints are fairly easy. When Sonic collides with one of them, set a global value to something (IE : 0 for the starting point, 1 for the first checkpoint, 2 for the second, etc). Make sure that a lower value can't rewrite a higher value (IE : If Sonic skips the first checkpoint, hits the second, and then backtracks to the first, don't allow the global value to be set back to 1)

Now, whenever the level restarts, reposition Sonic based on the value of the checkpoint.

Hope that's helpful.

Link to comment
Share on other sites

Checkpoints:

Objects to use:

Sonic- Character's Mask

Checkpoint- save point

End_Marker- End panel, after boss is defeated of everything that makes you to finish the level.

Start_Marker- Object that indicates where Sonic appears at the start of the game.

Values to use:

"Global Value X" = Keeps the X position where sonic must appear

"Global Value Y" = Keeps the Y position where sonic must appear

"Global Value Z" = 0 means Sonic is going to start at the beggining. 1 means that sonic will start at the last checkpoint.

//Inicialization

At the very first frame:
+set "Global value Z" to 0

//Set position of the character at the start.

At start of the frame 
+ "Global Value Z" equals 1
            set X("Sonic") at "Global Value X"
            set Y("Sonic") at "Global Value Y"


At start of the frame 
+ "Global Value Z" equals 0
            set X("Sonic") at X("Start_Marker")
            set Y("Sonic") at Y("Start_Marker")

//Set next appearance to the touched checkpoint

if sonic collides Checkpoint 
           set "Global Value X" to X("Checkpoint")
           set "Global Value Y" to Y("Checkpoint")
           set "Global Value Z" to 1

//Set next appearance to the Start of the level

If sonic collides End_Marker:
           set "Global Value Z" to 0

===============================================

Homming Attack

This could need some fixes i missed, but it shall work

Objects to use:

Sonic- Character's Mask

Sensor- 128x128 (or desired size) invisible circle with hotspot at center.

Magnet- invisible object with ball movement at max speed 32 directios.

Group.99- Qualifier assigned to any hommed object.

//Set up

Always:
	      set Sensor position at Sonic (0,0)

Start of frame:
	      destroy Magnet

//Be sure to do this on your jumping event

Sonic is on ground
+Player holds fire1:
	      Make Sonic Jump
	      Set flag 0 on ("Sensor")

//for safety

Sonic is on ground

Set flag 0 off ("sensor")

[/code]

//Activate the chance of making a homming attack

(X)Sonic is on ground
+ (X)Player holds fire1:
	      Set flag 0 off ("sensor")

//If the conditions are met, we create the homming attack object

(X)Sonic is on ground
+ Player Holds fire1
+ Sensor is overlapping ("group.99")
+ Sonic animation is playing ("Jumping")
+ flag 0 is off ("Sensor")
+ only one action when the event loops:
	      Create Magnet at Sonic(0,0)

//If the homming attack object exist, we do homming

count ("Magnet") > 0
+ Sensor is overlapping ("group.99")
+ Player Holds fire1:
	      Magnet look at Group.99(0,0)
	      Set sonic Position at Magnet(0,0)
	      Set sonic animation to Jumping
	      Set sonic speed to 0
	      Set sonic gravity to 0

//Finishing homming if any of those conditions are met

Sonic collides with a backdrop:
	      Destroy magnet


(X)Player holds fire1:
+ count ("Magnet") > 0:
	      Destroy magnet


(X)Sensor is overlapping ("group.99")
+ count ("Magnet") > 0:
	      Destroy Magnet

//

//Optional things

//

//creating a trail

count ("Magnet") > 0
Create trail object

Trail Animation is finished("Stopped")
	      Destroy Trail

//enemy destroyed- Making Sonic to bounce

Sonic collides with enemy when jumping and any condition to destroy the enemy
+ count ("Magnet") > 0:
	      Destroy enemy
	      Destroy Magnet
	      Set Sonic gravity to 16*Sin(11.25*(Magnet.direction+16))
	      Set Sonic Speedto 16*Cos(11.25*(Magnet.direction+16))

(Not sure if angle is right. Try Adding +90 or -90 to get the right angle)

//Not enemy found/ button released - Inertia

(X)Player holds fire1:
+ count ("Magnet") > 0:
	      destroy magnet
	      Set Sonic gravity to 16*Sin(11.25*(Magnet.direction))
	      Set Sonic Speedto 16*Cos(11.25*(Magnet.direction))


(X)Sensor is overlapping ("group.99")
+ count ("Magnet") > 0:
      destroy magnet
	      Set Sonic gravity to 16*Sin(11.25*(Magnet.direction))
	      Set Sonic Speedto 16*Cos(11.25*(Magnet.direction))

(Not sure if angle is right. Try Adding +90 or -90 to get the right angle)

  • Like 1
Link to comment
Share on other sites

  • 3 weeks later...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...