The Daily Click ::. Forums ::. Klik Coding Help ::. Flies with letters ....
 

Post Reply  Post Oekaki 
 

Posted By Message

Lazernaut



Registered
  08/09/2002
Points
  1103

VIP MemberThe Cake is a LieIt's-a me, Mario!Wii OwnerPokemon Ball!
2nd December, 2003 at 09:39:23 -

I'm making a game where you control a character who can shoot rockets upwards. This character can only move left and right. The enemies are flies who come in from the side, with different letters in held in their legs. The aim of the game is to spell a certain word by shooting the flies and collecting the appropriate letters. My problem is, i don't know how to code the events that make these flies come in with letters that follow the flies...i've been thinking about using the "spread value" thingy..but i'm not sure...

 
n/a

Hplkopra



Registered
  30/08/2002
Points
  65
2nd December, 2003 at 16:05:56 -

Umm... If I understood right, do it like this:
Create a active object, a text object and a some sort of identifier that is between the fly and the letter. And the player and the weapon and so on...
Always: Set position of the letter 0,0 of fly

Start of level: Create a sertain number of flies to the side of the frame, create a letter under each one, Randomize the letter by creating a random number 0-25, if it's 1, It's A, if it's 2, it's B and so on...

If the bullet hits the identifier between the letter and the fly, get the string of the text object, set it into the word that you have to spell or whatever, make the fly die.

I'm NOT sure, I just guessed so.

 
Try to solve the mystery of this signature.

Lazernaut



Registered
  08/09/2002
Points
  1103

VIP MemberThe Cake is a LieIt's-a me, Mario!Wii OwnerPokemon Ball!
2nd December, 2003 at 16:22:36 -

I though of something along those lines myself. I was gonna have the letters as active objects..but i think that might actually make it easier... and the word you gotta spell were supposed to always be the same..

 
n/a

cake



Registered
  13/12/2002
Points
  1173
3rd December, 2003 at 05:29:19 -

If the flies already start created then this is a little easier, however in this example I am going to assume that they are created during run time.

Objects:

Fly - AO
Letter - AO (or string if u want but i wouldnt recommend it due to bg refreshing problems) (use directions of it to show different letters, with right(0) being "A", down(24) being "X", etc)
StringData - String Object (this will store what letter to retrieve corresponding to a fly's value when it is destroyed. Make the text of the string be: "ABCDEFGHIJKLMNOPQRSTUVWXYZ")

Events:

1.
Number of Letter < Number of Fly:
Create Letter at -64,-64

2.
Number of Letter > Number of Fly
+ Pick one of Letter:
Destroy Letter

3.
Always:
Spread value 0 in Value A of Fly
Spread value 0 in Value A of Letter

4.
Flag 0 of Fly is OFF:
Set Value B of fly to random(26)
Set flag 0 of Fly ON

5.
Value A of Letter = Value A of Fly:
Set position of Letter at 0,0 from Fly
Set Value B of Letter to value B of Fly
Set direction of Letter to Value B of Letter

6.
Missile collids with Fly:
Set Alterable string of Word to Alterable string of Word + Mid$(paragraph ("StringData"), Alterable Value B of fly, 1)
Destroy Fly
Destroy Missile

That should do it. Sounds like a neat game idea too

Image Edited by the Author.

Image Edited by the Author.

 
n/a
   

Post Reply



 



Advertisement

Worth A Click