Random Monster

For questions about using Classic.

Post » Mon Mar 29, 2010 9:02 pm

I am still struggling with the boxes, I miss the code case statement. LOL

So where did I go wrong? And is there an easier way to structure the random monster selection? (note only forest works now)

http://www.box.net/shared/vxt1f87ygd

Thanks
B
28
S
8
G
8
Posts: 530
Reputation: 7,154

Post » Mon Mar 29, 2010 9:34 pm



Else only works with conditions at the same level. Eliminate most of the condition nesting. I also moved the comparison condition for the global 'terrain' to under start of layout, as it only needs to be done once.
B
79
S
24
G
53
Posts: 4,728
Reputation: 40,219

Post » Mon Mar 29, 2010 10:33 pm

Sort of getting it. Code is still easier for me.

But why did you move Forest to Start of layout? So it only runs once? In this case is I think it is not necessary but was that for better form or future problem solving?

Thanks R0J0hound, your Top Dog with me.

Oh Top Dog? I smell title. LOL
B
28
S
8
G
8
Posts: 530
Reputation: 7,154

Post » Tue Mar 30, 2010 10:57 am

[quote:3urh9hhc]But why did you move Forest to Start of layout? So it only runs once? In this case is I think it is not necessary but was that for better form or future problem solving?[/quote:3urh9hhc]
Yea, I moved it so that it is only run once otherwise it will be run every frame. It's trivial in this case, but with large projects it's good practice and reduces the number of events evaluated per frame.
B
79
S
24
G
53
Posts: 4,728
Reputation: 40,219

Post » Tue Mar 30, 2010 3:35 pm

Good point.

Thanks you
B
28
S
8
G
8
Posts: 530
Reputation: 7,154


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 9 guests