Read-only archive of the Armageddon Games Forums Archive (2000–2026) · About this archive

add-on to Joe's random movement script?

5 replies · 2,265 views · Started 06 October 2008

Ok, so lately I've been working on level 2's boss in Island of Dreams. I was looking for a random movement script for the boss itself, and I found one! The only problem is that when I was testing it by linking the boss FFCs to the script FFC, the boss would always move off the screen sooner or later. I need a way to make it stay inside the screen. Can anyone help me with this?

Well, is your boss only 1 tile wide or is it bigger? Because if it is bigger, you'll need to modify those lines:
if(this->X < 8){
if(this->X > 248){
if(this->Y < 8){
if(this->Y > 168){
8, 248 and 168 need to be others numbers if I clearly understand the script itself.
And maybe those lines also need to be changed:
this->X = (Rand(240)+8);
this->Y = (Rand(160)+8);
160 and 240 might have to be changed...

Yeah, the level 2 boss is going to be 3x3 combos. I'll try changing the script now...

Edit: Ah! Your solution wasn't correct, lucas, but it led me to realize what I had to do! Near the top, where it told the engine to put the ffc on a random spot on the screen (this->X = (Rand(240)+8);
this->Y = (Rand(160)+8); ), I had to replace those random values with the values that are equal to where I put the boss itself. The script FFC had been spawning in a place on the screen completely different than the boss FFCs, and the script only affected the Script FFC! So the Script FFC now acts as a sort of 'core' to the boss. Sorry if it seems like I'm rambling. :P

You are still partially right, about having to change these lines:
if(this->X < 8){
if(this->X > 248){
if(this->Y < 8){
if(this->Y > 168){
That's the controlled area Joe mentioned in his topic title.

Nah, it's alright, I wasn't expecting to have the good answer. I just gave you ideas and you made it work so it's all fine. 😊

Ah well, I'm glad this has come in handy =)

When I wrote it, I thought to myself that it'd be worth posting, incase someone wanted to use it for a custom boss one day.

Oh yes, it certainly did come in handy. Thank God for you Joe, at least half the scripts in Island of Dreams were made by you. 😃