(Air)ship Implementation
Displaying 1-6 of 6 total.
1
Please enter a numerical value for the importance of this sticky.
Enter 0 to unsticky.
Code

I need some advice on adding airships to my game. It's an original idea, I know. I'm not sure what the best way to do it is. Here's what I've come up with.

Make an array that stores the x and y of every single obstructed tile and use SetObs() inside a loop whenever the player enters or exits the airship. (Removing or restoring the map obstructions, respectively)


Use zones instead of obstructions. I'm not sure if this would actually be feasible. I suppose I would need to disallow movement in a particular direction when the player comes into contact with a particular zone and is not on an airship.

This happens to be a screenshot directly from my game. Look for it in the Gallery section soon.


For ocean-going ships, I suppose could have a very small obstruction tile and a zone that would activate upon pressing b1, repositioning the player on the other side of the obstruction, on land.

######
# #
# P #
##/\##
##||##
#----#
# S #
######

This is also a screenshot from my game. P is the player, S is the ship.


So those are my ideas. I'm not so sure the last two would work. What would you do? What would Jesus do? WWJD? How would Jesus implement airships in his game? HWJIAIHG?

Sorry, I got off on a tangent there. Anyway, how would you do it?
Thanks!

Posted on 2005-10-11 20:51:30

mcgrue

For an airship that cannot be blocked by anything, you make the sprite the player, and you set the entity.obstruction = 0 and entity.obstructable = 0 while you're flying around. You change back to normal party mode only when you've parked the airship in designated landing zones, that you can easily use zones for.

As for the ship, I've been pondering this myself. It'd be superhandy for there to be a way to make multiple obstruction layers in maped and toggle between them at will. Since this isn't happening anytime soon, my solution was to make the overworld outlines in 1px-thin obstructions, and have a zone on 'ports' that switches between ship mode and party mode.

That clear, or should I explain further?

Posted on 2005-10-11 22:09:30

Code

Okay, thanks. I didn't see that there were entity.obstruction and entity.obstructable variables. D'oh.
And yeah, I understand about the ship too. That sounds like the easiest plan.
Thanks!

Posted on 2005-10-12 12:03:46

basil

If it's not a huge map a possible (if inelegant) solution would be to simply have another copy of it with different obstructions, so that as soon as you get in the boat you switch the map.

Or you could draw a black and white picture of the world map in MS paint where all the obstructions you want are black. Correlate the boats position to a place on the picture, and use getpixel to check whether the player is trying to move into a black part (obstruction). It seems better than storing everything in an array, which would be a nightmare to edit.

My 2 cents.

Posted on 2005-10-12 15:15:23

mcgrue

That 'draw and import' idea is interesting...

Posted on 2005-10-12 17:37:59

Code

Wow, that is a really good idea!

Posted on 2005-10-12 21:35:36


Displaying 1-6 of 6 total.
1
 
Newest messages

Ben McGraw's lovingly crafted this website from scratch for years.
It's a lot prettier this go around because of Jon Wofford.
Verge-rpg.com is a member of the lunarnet irc network, and would like to take this opportunity to remind you that regardless how babies taste, it is wrong to eat them.