Taking on a Zelda Clone: Part 5

I got a couple more hours today to work on this, so I made some more progress. Not as much as previous days, but still some good things.

Enemies
I gave enemies an “appearing” animation similar to what Zelda 1 uses. Having them just suddenly appear was kind of bleh, but now a little poof of smoke appears first, making it look nice and professional.

Poe quickly drew up another enemy, this time it’s a mouse. So I added it in there in under a minute.

Rooms
I finally expanded the Room class a little bit and added some more features. I also finally went and created room connections, which means rooms/screens can now connect to each other, meaning the player can now go between different screens, hurray!

Right now there are only four rooms, none of them particularly special or anything. I added some new tiles to spiff things up, but like everything else here, it’s all just temporary and for the purposes of building this engine.

I’m pretty happy with how the room connection stuff works, except I might’ve overcomplicated things a little bit, at least in regards to how room numbers are assigned and how the game knows which room to get to during a room change. It’s not set up how Zelda is right now, and if I ever end up making a map-making program, the current setup will make it less intuitive and annoying to use. So it still needs tweaking.

Foreground layer
I created a foreground layer that allows for different effects for different rooms. Zelda 1 obviously doesn’t have this, but I got to thinking, and although I want to very much keep the same general look and feel as Zelda 1, I’m also doing this to make games that I wish existed – games that I’d play in an instant if I saw screenshots or a video of. So with that in mind, I’m taking some basic, simple liberties with this sort of thing.

Anyway, one place I added this foreground layer in is in the graveyard, as a semi-transparent mist. I didn’t know what kind of shapes to use, so I thought back to Zelda 3 and Super Mario World and how they did similar stuff. I think the end result looks great and gives the whole room a lot more atmosphere.

I also added a dusty-looking layer to the desert room, just to see how it looked. I might use this effect in this way for some parts of the game, I dunno. I think it might come in useful in dark caves that you can light up and stuff, too.

Music
By now the game was starting to really feel Zelda-y, but it was missing something. I played it while listening to some music from the 3D Dot Game Heroes soundtrack and it really gave it an extra boost. So then I tried listening to the Zelda 1 overworld music while playing, and wow, sometimes it really did feel like I was playing Zelda 1 again.

So, for temporary fun, I’ve added the Zelda 1 music to the game itself. I’ll probably take it out of future builds to keep the music from digging into my soul 😛

Movement
My current tile collision detection works properly (or at least I think so, but I might be wrong after some weird stuff happened earlier) but it’s very inefficient and not well-designed. So I haven’t improved the thing where trying to get into tight vertical corners is tough. It’s high on my list of priorities, but I think first I’ll need to just rethink and redo the entire collision detection.

Code
Man, the code is a huge file full of messiness now. I really wish I knew how to break the project up across multiple C# files, if anyone knows how to do this please let me know! I’ve done some quick online searches but they’re such vague keywords that I get lots of unrelated stuff instead.

NPCs

I plan on having most of the people you meet in the game just act like the old people in Zelda 1 – they say their text on the screen right away. Here I tested it out with just some pre-drawn tiles, but at some point I’ll make them work properly. They probably won’t look like this guy though, who’s based off of the old guy in Zelda 1.

Graphics & audio
This entire time it’s been obvious that the graphics are going to need to be done a lot better than what my measly skills can do. Luckily Poe’s been handling a few things, at some point I’m going to need to really up my pixel art skills though.

Similarly, at some point we’re going to need real music, and although it’d be easy to ask for help or just steal music from somewhere, this might be a good chance to finally learn music and music composition. I tried messing with Famitracker about a month ago and got some simple jingles done somehow.

In any case, this project (and future ones) are sure to be educational in terms of art and music creation too, not just programming.

Thoughts
Programming fun stuff is always a real thrill, it’s nice to be doing it again. I’ve also realized that many of my classes and functions I’m developing can probably be used as-is in completely different games and even completely different genres of games! And I bet with enough time and enough projects, I’ll have a big library of my own code. Like, I already have a basic RPG-style textbox class from the other day, I could just plop it into this project without much work. But I’m hoping there’s some better way to do that than copy and paste the class into the main source file…

At any rate, the engine is now very Zelda-like and just needs a lot of tweaking and polishing. It’s cool to see that in just a dozen hours or so total I’ve gotten this much done!

Download

Both comments and pings are currently closed.

5 Responses to “Taking on a Zelda Clone: Part 5”

  1. phee says:

    Use a separate file for each class. Map, room, entity, enemy, sound, game, player, input, keyboardinput

  2. Archaic Sage says:

    It’s great reading about this game progress Mato, it’s really interesting. I just wish I had your skill in learning programming!

    In terms of enemies, all of them seem to drop something and I don’t find this very “Zeldary”. Is there a way of making the item drops not on all enemies?

    • Mato says:

      Yeah, that’s a very easy fix, it’s mostly a remnant of testing to see if the item drop system worked and then I never turned it back down from 100% afterward 😛

  3. Carl says:

    Thanks for sharing your work on this project. You’ve encouraged me to finally get started on something I’ve been meaning to do for years, which is learn to actually program for the NES. I’m hoping to eventually be able to create a complete NES game, though that’s probably a bit optimistic. But reading about your work on this project has inspired me. Thanks again!

    • Mato says:

      Ha, that’s cool, that’s been a big goal of mine too. I started tinkering with NES programming a little while back but getting anything done was a huge chore – even just dividing two numbers requires you to write an actual divide function of your own so I moved on to this for a while.

      I look forward to seeing your projects, definitely share them as you work on them!

Subscribe to RSS Feed Follow me on Twitter!