Jump to content


Beowulf

Member Since 26 Jan 2012
Offline Last Active Today, 02:29 PM

Posts I've Made

In Topic: Testing For Which Child Of A Parent It Is

Today, 12:50 AM

Oh, that makes everything so much easier! :D Thank you! Thanks to everyone else for taking the time to reply as well. :)


In Topic: Testing For Which Child Of A Parent It Is

Today, 12:25 AM

If you are just wanting to know what object the child is, just use object_index.

Could you specify?


In Topic: Testing For Which Child Of A Parent It Is

Yesterday, 08:32 PM

 

A super simple and inefficient way would be to create a variable called "type" and each weapon would have a unique type... ie type='shotgun' or type='rifle'.

 

However... I would use arrays.

 

You could always create an array and store the IDs inside the array.  So when an object is created... iterate through the array and see which is the next spot open and put that ID in there.  When a weapon is picked up, remove the ID from the array to open that spot up again so that the array doesn't become insanely huge.

 

So, if you have 10 weapons, this code will create 10 spots in the array that equal 0:

var i;
i = 9;
repeat(10)
   {
   array[i] = 0;
   i -= 1;
   }

When you create a weapon run this code to place its id number in an array spot.

var i;
i = 9;
repeat(10)
   {
   if array[i] = 0 {array[i]=id; break;}
   i -= 1;
   }

When the player collides with a weapon, have it run this code to remove the weapon id from the array.

var i;
i = 9;
repeat(10)
   {
   if array[i] = id {array[i]=0; break;}
   i -= 1;
   }

Wow, thanks! I'll try that out. Usually I don't work with arrays,  but I guess I might as well start now. :P Thanks again.

**EDIT: Woops, I replied inside the quote. :teehee:


In Topic: Locking rooms

06 January 2013 - 05:32 AM

do you know how in angry birds, the rooms are locked until the previous room is completed? i need to know how to do exactly what angry birds does, including when its locked, the sprite it has is a lock, and when its unlocked, the sprite is normal..

thanks all, ConkerMods

Make a variable to test if the room is locked. For example, have a variable: Level2Locked = true.
Then, when the player completes level one, set Level2Locked to false. As for the lock sprites, use 'If Level2Locked is equal to true then set the sprite to locked sprite, else if Level2Lockedis equal to false set the sprite to unlocked sprite.' Sorry if that's a bit confusing, I'm not the best at explaining.   :confused:/>

EDIT: Use that method, it uses less code and variables^

In Topic: Turn-Based RPG Attack Style?

04 September 2012 - 01:52 AM

Also, for HP would you rather have numbers like currentHP/maxHP or healthbars?