Sonic style deaths

Non-platform specific questions.

Sonic style deaths

Postby CrimsonTheDarkBat » Sun Jan 08, 2012 6:17 pm

Ok, in the words of Steve Jobs: one more thing...

I basically want the player in my game to have the same "death system" used in the Sonic the Hedgehog games. For example, the player collects rings scattered throughout the level and I want it so that when the player hits the enemy while not attacking, the ring count is reset to zero. But - the big thing is this: I want the players death event to only take place if the player hits an enemy while the ring count is at zero. How do I do this?

Thanks and whatnot!
Sonic Velocity Development Thread --> http://game-editor.com/forum/viewtopic.php?f=4&t=11461

Completed Games:
Sonic: War of the Emeralds
Sonic: Empire of Nightmares
Sonic.EXE - The Game
Alice: Crimson Omen
Epsilon 27
User avatar
CrimsonTheDarkBat
 
Posts: 223
Joined: Fri Mar 21, 2008 10:54 am
Score: 20 Give a positive score

Re: Sonic style deaths

Postby phyzix5761 » Sun Jan 08, 2012 6:34 pm

on the collision event (or whatever event the hit happens on)

do something like this:

Code: Select all
if(rings>0)
{
  rings = 0;
}

if(rings==0)
{
  //do death sequence
}
phyzix5761
 
Posts: 261
Joined: Sun Feb 27, 2011 4:28 am
Score: 18 Give a positive score

Re: Sonic style deaths

Postby savvy » Sun Jan 08, 2012 7:11 pm

as he said but with expansions.

Code: Select all
int i;
if(rings>0)
{
  for(i=0;i<rings;i++)
  {
createfloatingring;
}
  rings = 0;
}

if(rings==0)
{
  //do death sequence
}


Then inside the floating rings, on create put.

Code: Select all
directional_velocity=rand(maxspeed)+minspeed;
angle=rand(360);


change min and max speeds to the speeds.

helpful?

savvy
--> For my help, i ask for a simple +1 if it helps! ^-^
--> I dont code, I type art which you dont understand.
--> I keep winning the 3D model challenge at college, teacher says: "you keep winning im not giving you prizes".
User avatar
savvy
 
Posts: 494
Joined: Wed Jun 03, 2009 11:55 am
Location: England
Score: 44 Give a positive score

Re: Sonic style deaths

Postby SuperSonic » Mon Jan 09, 2012 4:10 pm

I would like to add something. Instead of using "if(rings == 0)", just use "else" :wink:
A tree never hits an automobile except in self-defence.

Want to use your joystick or controller with Game Editor? Check out my controller engine =D
User avatar
SuperSonic
 
Posts: 1443
Joined: Fri Sep 24, 2010 9:24 pm
Location: Anywhere
Score: 72 Give a positive score

Re: Sonic style deaths

Postby foleyjo » Mon Jan 09, 2012 4:23 pm

CrimsonTheDarkBat wrote:Ok, in the words of Steve Jobs: one more thing...


I think you mean columbo :lol:
KISS -Keep It Simple Stoopid
foleyjo
 
Posts: 275
Joined: Mon Jul 09, 2007 1:15 pm
Score: 15 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest