The Daily Click ::. Forums ::. Klik Coding Help ::. Regenertating Enemies.
 

Post Reply  Post Oekaki 
 

Posted By Message

Marvel Hero



Registered
  15/08/2003
Points
  412
26th October, 2003 at 19:00:42 -

Is there any way to make enemies that dissaper when they move of the screen, and regenerate when you come back to certain areas???

 
n/a

ChrisB

Crazy?

Registered
  16/08/2002
Points
  5457
26th October, 2003 at 19:13:51 -

1. This goes in Code-It
2. Yes there is
3. Be more specific

 
n/a

Pete Nattress

Cheesy Bits img src/uploads/sccheesegif

Registered
  23/09/2002
Points
  4811
27th October, 2003 at 13:08:56 -

just moved the post to code-it to make chris look stupid.

 
www.thenatflap.co.uk

Galaxy613



Registered
  29/01/2003
Points
  1765
27th October, 2003 at 13:49:21 -

that wasn't nice...but it was... oh well...

Back to your problem, yes there is many ways we just need to know more like..
What are you useing? MMF or TGF?
What tpye of game are you trying to make?
and other stuff

 
Image
My forum: http://subsoap.com/ck/forums/index.php

AndyUK

Mascot Maniac

Registered
  01/08/2002
Points
  14586

Game of the Week WinnerSecond GOTW AwardHas Donated, Thank You!VIP Member
27th October, 2003 at 14:28:52 -

do you mean enemies that dissapear when not on screen but they're remembered so they can come back later.

 
.

LittleGuy (Ecstasy Studios)



Registered
  22/12/2002
Points
  1497
27th October, 2003 at 15:39:52 -

Sounds like pretty basic stuff to me. From the limited info you gave the best I can surgest is:
>When enemy leaves screen - destroy
>On blaah Blaah trigger - Create enemy at blah blaa co-ordinate

 
A Crusader for the LittleGuy's

Click Cell, a full fat community site, http://clickcell.tk

ChrisB

Crazy?

Registered
  16/08/2002
Points
  5457
27th October, 2003 at 20:08:59 -

Oh no, foiled, but I'm still right

I believe the following MMF events are also valid:

• On Cheese
(Mouth) : Say "Blibble" at speed 50

• Badger badger badger badger badger badger
+ Badger badger badger badger badger badger
(Mushroom) : Mushroom

 
n/a

Marvel Hero



Registered
  15/08/2003
Points
  412
27th October, 2003 at 21:35:12 -

This is code it. I want enemeies that dissapear when there not on the screen with the player and I want them to come back when the player reaches a certain spot in the level. Like in the old megaman games, the enemies could always come back, and in the same spots.

 
n/a

Pkeod

Oontz Oontz Oontz

Registered
  19/11/2002
Points
  93

VIP Member
27th October, 2003 at 21:41:48 -

Then you would have objects (or just plain cordinates) so every 1(or how often to check) second if number is less then desired amount = create object at coridnates' pretty basic.

Now if you want it to identify objects with what point they are supposed to be at you have to create an event for each person now the best way for this to work is on start of level + object is over object you use to identify by (known as a spawning point) = set value of the enimie object to a number that relates to the identifier object, all ident objects MUST be diffrent for this to work.

then in the code
object alt value = 5
Number is less then desired amount
then
Make object at spawn point, and set value to 5

get it?
maybe some one can clarify if i am too criptic.

 
Faerie Solitaire - Get it now:

http://www.create-games.com/download.asp?id=7792

Radix

hot for teacher

Registered
  01/10/2003
Points
  3139

Has Donated, Thank You!VIP MemberGOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!
28th October, 2003 at 01:07:18 -

I think I know what you mean. You want enemies that don't move around unless they're on the screen with you, and you want them to come back if you've killed them and return to the same place, right? Very NES-ish.

Assuming there's more than one of each type of enemy, I'd do this:
Place an invisible active object where you want your enemies to spawn. At the beginnign of the level, assign each of these a random number (in, say, alterable value A). This will serve as an ID for each spawn point.
When the spawn point is (say)5 pixels from the edge fo the screen (or a set x and y distance from the player), create an enemy of it's type on top, and assign it the A value of the spawn point it's over. So a spawn point with avA=987 would only create enemies with avA=987.
If the enemy is not satisfying the condition of being a certain distance from the player (that is, outside the screen), then turn on a flag that tells it to stop moving (or self-destruct if the spawn point is also not on screen, if that's your aim).
When a spawn point comes back on screen, it tests for enemies with it's own A value. If none exist, that means it's been killed and it creates a new one. This might not be necessary if you choose to have enemies die when they go off screen. In that case you wouldn't need the ID number, I guess, but it'd be helpful to test if both the spawn point and enemy are on screen if you have spawn points near each other.

That's a little overcomplicated, but you get the idea.

 
n/a
   

Post Reply



 



Advertisement

Worth A Click