I must be doing something wrong...

For questions about using Classic.

Post » Fri Aug 28, 2009 1:14 pm

[quote="Magnet Missile":1o8u0hkg]3. Notice the coins? Each one increases a global variable when touched, but I can't figure out how to display it. What I've tried before doesn't work.[/quote:1o8u0hkg]

That's the easiest problem you have. Just add a text object and set its text to Global('Coint count') in an always event.

As for the enemies I have a general advice for you: use private variables to control their behavior! I added PVs for the delay between shots, for the general status (is shooting or not), the time it will wait between two attacks and all that. Sometimes there are double values, like MaxShots and CurShots for the Sniper. Maxshots is the amount of shots it will fire in one attack. CurShots counts the fired shots, in order to stop the attack, when Curshots equals Maxshots.

For some values like Rate you could use a Global value instead, since it's just the amount you subtract from a certain value. This doesn't really need to be sprite specific.

Regarding the plant: you added 8 directions movement, but you didn't use any of the movement's actions. Instead you used 'Move at angle', which works differently. The amount of pixels you set will be moved instantly in 1 tick! I used Ball Behaviour for the plant, which fits the purpose better. You could also use Bullet of course.

With all the values you can easily control the behavior of your enemies and you can have different instances acting differently by just changing some values. Although I may not have done it the most elegant way here, it's generally speaking the way to go.

I didn't comment the cap, there aren't many events though. The hard part will be to figure out which PV is there for what purpose. But I bet you can figure it out when you have a closer look.

Your cap with changes

If there's something else, you can always contact me.
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445

Post » Sat Aug 29, 2009 9:40 am

Thanks! I really appreciate it.

First of all, why won't Construct let me copy events from one project to another? Some times I tried it even caused an error that closed Construct! It makes things take a lot longer.

For the Global Variable thing...I was making two mistakes. First of all, I wanted the text to say "Coin Count X" before the actual variable was displayed, which just made a mess of text. I didn't realize you couldn't put text there! That solved that problem. Then I set it to "Start of layout" so it didn't update the variable when I picked up coins. "Always"! Duh.

The piranha plant works great! I copied all the info from your edited cap and then adjusted the speed to suit my liking.

I didn't put the Sniper Joe back into my Mega Man project yet, but what's in the cap looks great.


Private variables, they do a LOT more than I thought they would. All I thought of using them for before was for stats, like HP and attack power and stuff. It's a bit confusing though, it might take me a bit of time to figure them out myself.


I hate to be a bother, but I have another problem. I have no idea how to go from one Layout to another. In my Mario game, Mario appears in a different place based on where I enter the castle from (I lazily set it so pressing up anywhere in front of the castle makes you enter) and sometimes there's two Marios! The screen also feels like not scrolling after going between layouts sometimes. I don't really understand how to go about this. When I tried using events to move the player to a specific place, things got even worse. My first guess now would be to try and use private variables or something, but...I'm stumped at the moment.
B
3
G
3
Posts: 14
Reputation: 903

Post » Sat Aug 29, 2009 11:52 am

[quote="Magnet Missile":3a2zz1yo]I have no idea how to go from one Layout to another.[/quote:3a2zz1yo]

Use this action:


And always be sure to name your layouts properly and call them by name and not their number. Will avoid a lot of confusion.

[quote="Magnet Missile":3a2zz1yo]In my Mario game, Mario appears in a different place based on where I enter the castle from (I lazily set it so pressing up anywhere in front of the castle makes you enter) and sometimes there's two Marios! The screen also feels like not scrolling after going between layouts sometimes.[/quote:3a2zz1yo]

When you're simply using the action above, stuff like this shouldn't happen. Remember to include the needed event sheets in all the layouts (like player animation, your scrolling... etc.) And you may need to set certain objects (like the player sprite) to global, so it can be accessed in every layout. If you're still having problems with this, you know the deal: share a cap. :wink:
That way I can see exactly what's going wrong.
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445

Post » Mon Aug 31, 2009 11:12 am

Oh, it does work better to use the names instead of just the number!

My main problem now is how to make the player appear in a certain place upon switching layouts.

For example, Mario enters the castle by standing in front of it. Then I want him to appear at the castle's inside entrance (different layout) in a specific place. When he walks out of the castle (by walking off screen at a specific point) then I want him to appear at the previous layout in the same place he was before he entered the castle. Does that make any sense? I can't figure out how to do it, and I'm not sure if I should use variables or something to store the X and Y positions, it seems like that might clutter up the variables if I don't know what I'm doing and having too many variables might make things confusing for me. I still haven't figured out all of the Piranha Plants variables you had in the cap, thought messing around a little will probably solve that.
B
3
G
3
Posts: 14
Reputation: 903

Post » Mon Aug 31, 2009 3:42 pm

[quote="Magnet Missile":24ao8p5o]My main problem now is how to make the player appear in a certain place upon switching layouts.[/quote:24ao8p5o]

Well how are you trying to achieve this atm? I'd simply put a dummy sprite where I want the character to appear and set the player to its position on startup. Pretty simple I guess.

Going back would work the same way. Have a dummy sprite at the castle door to let the player reappear there. If there are multiple of these objects in a layout, you could use a global to decide where to appear (a global matching a PV on the dummy sprite). That global would be set in the previous layout of course.

Hopefully that's already enough info for you to work it out. :wink:
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445

Post » Fri Sep 04, 2009 11:11 am

Messing around a little and I got it working better! I finally got the screen to scroll normally in the castle! This will take some time to get down though. Variables are confusing sometimes.

I tried adding Peach in as a playable character...using her Mario 2 sprites and moves. I tried giving her that float ability she has...but...wow...it's not coming out right. I'm not 100% sure about this because I haven't played Mario 2 in a while, but while in the air, if you press and hold the jump button again, Peach will float at that height for about 2 seconds, able to move left and right, but she can only do it once per jump. Would using private variables make that easier? My first attempt at making her float just gives her some kind of uber-float that lets her soar endlessly horizontally, unable to land...

(if you don't know what I mean by Peach's float ability, I could look for a video of some kind to help demonstrate it better)
B
3
G
3
Posts: 14
Reputation: 903

Post » Sat Sep 05, 2009 1:17 am

[quote="Magnet Missile":1c42uj8e]Messing around a little and I got it working better! I finally got the screen to scroll normally in the castle! This will take some time to get down though. Variables are confusing sometimes.[/quote:1c42uj8e]

See. Messing around is always the best way to roll. :mrgreen:


[quote="Magnet Missile":1c42uj8e](if you don't know what I mean by Peach's float ability, I could look for a video of some kind to help demonstrate it better)[/quote:1c42uj8e]

Are you actually implying that I don't know SMB games? :evil:
Not only do I exactly know what you mean by Peach's float ability, I could also tell you the color of her panties!

[quote="Magnet Missile":1c42uj8e]My first attempt at making her float just gives her some kind of uber-float that lets her soar endlessly horizontally, unable to land...[/quote:1c42uj8e]

Well, you could keep her VectorY at 0 for a certain amount of time, no? You could try something like that. I can provide an example if needed.
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445

Previous

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 7 guests