Castlevania Style Platformer

For questions about using Classic.

Post » Sat Jan 16, 2010 7:50 am

Hello all, I'm new,

So I'm working on a platform engine in the style of the DS Castlevanias. I want to be able to go from single screen rooms where the character exits the edge of the screen, and appears in a larger scrolling room, but I don't want to have to change layouts, any suggestions? I have no graphics at all, just coloured blocks, so when I say in the style of Castlevania, I simply mean the gameplay, not the look or story at all lol.

I'd love to post some caps to show what I'm doing, but I'm not sure how to get them online, like I said, I'm new lol.
B
64
S
8
G
9
Posts: 290
Reputation: 8,590

Post » Sat Jan 16, 2010 8:00 am

Why don't you want to change layouts?

Anyway, you could do this with events easily enough if you don't want to change layouts, just change the settings for layer scrolling, and an event to move the player to the new area elsewhere in the layout. As for the flip screen style, could use invisible trigger sprites at the edges of the screen, so when the player passes over them, it triggers an event to move the display across X number of pixels or something along those lines.
B
3
S
2
G
3
Posts: 628
Reputation: 2,531

Post » Sat Jan 16, 2010 8:50 am

That's a good idea, the main reason I don't really want to change layouts is simply because I can't seem to get any of my events to carry over to the different layouts, I guess I'm just not doing it right, and I don't want to have to copy/paste every single game event into every layout I use, so I guess my question should've been, how do I get room layouts to use events from my main engine layout
B
64
S
8
G
9
Posts: 290
Reputation: 8,590

Post » Sat Jan 16, 2010 9:38 am

[quote="brent_hamel":2pxrgoij]That's a good idea, the main reason I don't really want to change layouts is simply because I can't seem to get any of my events to carry over to the different layouts, I guess I'm just not doing it right, and I don't want to have to copy/paste every single game event into every layout I use, so I guess my question should've been, how do I get room layouts to use events from my main engine layout[/quote:2pxrgoij]

You can include an event list from another layout, that way anything in that event list will be available in any including it, and you only need to edit the single list to effect the others.
B
3
S
2
G
3
Posts: 628
Reputation: 2,531

Post » Sat Jan 16, 2010 11:03 am

Here's a simple method of creating camera zones that only uses two events:

http://dl.dropbox.com/u/529356/cameraZones.cap
(v0.99.72)

The zoneBorder objects (which are the red tiled backgrounds) have five pieces of information stored in each one as private variables. There is xMin, xMax, yMin, yMax, and "myZone."

The global variable "zone" indicates which camera zone the player is in. It starts off in zone 1 as the default. The system looks up the zoneBorder with the myZone variable that matches global('zone') and uses the min and max info to restrict the scrolling. Notice that even though there is empty black space in the layout, you don't see any at runtime.

When the player touches a zoneBorder it changes the global('zone') variable. They're set a space apart so that a player can't touch one and then turn around without un-touching the old zoneBorder, which could cause the camera to get lost. Notice also that the "inside" areas have identical information in the zoneBorder objects at either end. The two rooms in the middle each have two zoneBorders because there are two entrance/exit points that lead to the same space.

Anyway, here's how the scrolling works:

[code:13k9cl0z]System: Scroll to X:
clamp(player.x, zoneBorder.Value('xMin'), zoneBorder.Value('xMax'))[/code:13k9cl0z]

"Clamp" just means we're restricting a number between two points. We want to follow the player, but not above or below certain limits. it works like this:

clamp(target value, minimum value, maximum value)

If the target value is smaller than the minimum, then clamp will return the minimum. If the target value is larger than the maximum, then clamp will return the maximum. If the target is between the two, then everything is normal.

So, clamp says to follow the player, but if the player goes over or under the limit, then stop following. You can do this for both the X and Y axis, making single-room areas (like zone 1 and 3), one-way scrolling areas (like zone 2's horizontal-only scrolling) or two-way scrolling areas (like zone 4).

For more information on clamp() and other expressions, check out the wiki.

The numbers for the x and y values in the zoneBorder variables were just put there with a little math. You have to do a little figuring in order to set them up. For instance, if you have a screen that is 320x240 pixels (like in the example) then you will want to stop the camera half the distance away from the edge of the room, which is 160 pixels in the x axis and 120 in the y. This makes it so when you are half a screen away (that is, "centered" on the end of the room) then the camera will stop. Once you've figured out the numbers for the current zone, just type them in to the border object's values and you're done.

Also... I made the camera events on a second event sheet to show how to use external events. Notice under the Project tab there is a "cameraSheet" event sheet. You can open the sheet by double-clicking the icon.

This sheet can be used on any layout. I've included it in the Layout 1 Events by right-clicking in the event editor and selecting "Include event sheet."

Also note that you could control lots of other things with the global('zone') variable. You could make enemies active only when the player is in the same zone by checking if an enemy's "myZone" variable matches up, and set any enemies in other zones dormant. This could cut down on processing or simply keep them from chasing you into places where they shouldn't. You could activate ambient sounds or new music based on what zone you are in, or trigger other environmental things. Or start up a boss intro when you walk into a boss room, etc.

Anyway, if you have any questions, feel free to ask.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Sat Jan 16, 2010 4:27 pm

Wow, thanks a bunch, that seems like some pretty comprehensive help lol. Thanks guys. Though I seem to get a runtime error when I try to open your cap deadeye, I'm not sure what to do about that, I'm using the most current version of Construct so I imagine it's the "unstable" one I keep hearing about, would that be the problem?
B
64
S
8
G
9
Posts: 290
Reputation: 8,590

Post » Sat Jan 16, 2010 4:29 pm

[quote="brent_hamel":97lbltwp]Wow, thanks a bunch, that seems like some pretty comprehensive help lol. Thanks guys. Though I seem to get a runtime error when I try to open your cap deadeye, I'm not sure what to do about that, I'm using the most current version of Construct so I imagine it's the "unstable" one I keep hearing about, would that be the problem?[/quote:97lbltwp]

Yep, that'll be it, don't worry, the "unstable" 72 is fine to use.
B
3
S
2
G
3
Posts: 628
Reputation: 2,531

Post » Sat Jan 16, 2010 8:05 pm

You can always check out the Construct Discussion forum for the latest release. It's stickied at the top. They don't get put onto the front page until the community has had a chance to test them out. As such, they are marked "unstable," and sometimes they are, but there aren't any really glaring issues with 0.99.72, and it is a better version than 0.99.62.

If you're going to be a beta tester (and by using beta software, that's that's sort of implied ;)) then you might want to have the latest test build anyway. I mean, it makes sense, yeah? :)
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Sun Jan 17, 2010 12:59 am

To note: Changing layouts is really what you'd want to do, as it goes just the way that Castlevania's rooms behave: every enemy is reset.

-Make your player and player related objects global so you can reposition it.
-make an external event sheet for generic stuff that happens in every room
-include this external event sheet in every room
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Sun Jan 17, 2010 2:25 am

How do I post my .cap files so you guys can see where I suck lol
B
64
S
8
G
9
Posts: 290
Reputation: 8,590

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 4 guests