Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411500 Posts in 69373 Topics- by 58429 Members - Latest Member: Alternalo

April 25, 2024, 01:00:11 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityDevLogsMy anniversary game
Pages: 1 [2]
Print
Author Topic: My anniversary game  (Read 8504 times)
Randy
Level 0
***



View Profile WWW
« Reply #20 on: June 28, 2009, 07:15:30 PM »

Thanks for all the great responses and feedback on my project.  Things have been going great so far but I've hit another snag.  Two actually...  One is changing rooms.  I've done a bunch of research on how to do this and seen that I can do this lots of different ways.  The one that takes the least amount of code is this one...

Code:
//When I collide with an object with this code I should be taken to X room.

room_goto(roomindex);

object_name.x = number
object_name.y = number

Now, this totally works in the example I checked out but in my code, it doesn't.  What does happen, is the room changes to the one I want but my sprite object doesn't.  Is there something I need to add somewhere else for this to work?  Or is there just a better way to do it.

Also, When the room changes, my heart count goes back down to zero.  How do I keep the same number from room to room?

Thanks in advance ^_^
Logged
ChevyRay
Guest
« Reply #21 on: June 28, 2009, 07:58:10 PM »

If your hearts reset at the beginning of each room, it means that the code that sets your heart-variable to 0 is being called. It's either being called from a creation-event or a room-start/end event, so have a look. What I generally do is have an "init" script that's called when the game starts (and only then), which sets all the initial values for all global variables in the game... So at game-start, something like this:

Code:
global.hearts = 0;

Now, this is the only code in the game that sets global.hearts to 0, so we can be sure that it will never be called again (unless the game restarts, in which case you'd want it to. Anyhow, whenever you collect a heart object just call this:

Code:
global.hearts += 1;

And your global heart points will increase, and will remain static from room-to-room, not resetting.

Next up, moving from room-to-room. This all depends on how your room-transitions are set up. Do you have objects placed on the borders of the screen or something, or do you want him to change room when he walks off the screen? Are all the rooms the same size, or do they vary in size?

Smiley
Logged
Randy
Level 0
***



View Profile WWW
« Reply #22 on: June 29, 2009, 04:09:09 AM »

Well... I would love for all the rooms to be different sizes and for the room to change when the player walks off screen.  I'd also like there to be more then one way to exit the room.  So one entrance (west) but two exits (north, east).  But if that's too complex, then just having the player walk over a panel works too (which, I'd like to learn how to do too properly as well).  I've been doing what you've suggested and been reading the help file on this topic and I've learned a lot.  I've also had a lot of crazy things happen as I experiment.  Like, I've been able make a copy of myself every time I enter a room.  That was kind of neat, and might be useful for future ideas. ^_^

Mostly though, I'm able to go to the next room but my player object doesn't show up

I'll give the hearts thing a try on my lunch time.

Thanks again ChevyRay ^_^
« Last Edit: June 29, 2009, 09:11:28 AM by Randy » Logged
Randy
Level 0
***



View Profile WWW
« Reply #23 on: June 29, 2009, 09:09:34 AM »

Okay, so I've got the script going for my hearts count and when I go to the next room (in the broken fashion that I currently have) the number stays the same.  Yay!  But when I go back to the previous room... all the hearts come back.  So now I have to find a way to destroy the hearts completely once collected.

To the help section ah goooooo!

Here's the latest version.
Logged
medieval
Guest
« Reply #24 on: June 29, 2009, 09:45:33 AM »

In the room editor there should be a tick box somewhere that says 'Persistent'. if you check that, the hearts shouldn't come back.
Logged
Randy
Level 0
***



View Profile WWW
« Reply #25 on: June 29, 2009, 09:51:12 AM »

In the room editor there should be a tick box somewhere that says 'Persistent'. if you check that, the hearts shouldn't come back.

Holy crap!  That was so easy... and I had no idea that existed before.  Thank you very much. ^_^
Logged
ChevyRay
Guest
« Reply #26 on: June 29, 2009, 02:19:28 PM »

Yeah, I forgot to mention persistent rooms / objects Embarrassed

An instance of any object that is persistent, after its creation, will exist across all rooms from that point on. In the same manner, if you destroy that object, it will remain destroyed, and will not come back.

With rooms, they basically stay at the same state at which you left them. So all objects that were destroyed will remain destroyed, and everything will be in the same position. Makes collectibles quite easy.

Anyways, I'm downloading the latest now, and I'll see how the best way to implement a room transistion system will be.
« Last Edit: June 29, 2009, 02:23:28 PM by ChevyRay » Logged
ChevyRay
Guest
« Reply #27 on: June 29, 2009, 05:53:45 PM »

Hmm... it's kinda hard to setup a dynamic room-transition engine like that Crazy I can do it, but I don't know how to do it in a way that I can explain to you, or that is even that easy to implement.

Have you tried possibly doing it all in one BIG room, then just shifting the view? I wrote up an example, maybe it'll work out better for you:

http://properundead.com/examples/followcode.zip

This method just allows you to place Border objects in the single large room to define the edges of the smaller rooms contained within. It takes away the worry of having to fix up the player position as well. Also, because there is just one single room, you don't need to use persistent objects or anything like that. Objects that are destroyed will stay destroyed as long as you are still in this room Smiley

Tell me what you think. Once again, I didn't really explain much in the code Embarrassed but I'll let you take a glance at it to see if you can figure it out. Anything you don't understand, just say so here and I'll do my best Grin
Logged
Randy
Level 0
***



View Profile WWW
« Reply #28 on: June 30, 2009, 04:44:35 AM »

Wow!  That is just what I was looking for!  I thought this could only be done by switching rooms.  In fact, I remember reading somewhere someone said that using one big room is bad and that using small rooms and linking them together is best.

Okay, now I need to study and dissect this latest example to better understand it.  I have about a month and a half to get this ready and I think I have all the working parts.

I'll post again with my latest build as soon as I have more to show.  I do think it's funny how this example would have taken me a month but you've put it together in an evening.

Later... and thanks again. ^_^
Logged
ChevyRay
Guest
« Reply #29 on: June 30, 2009, 08:07:12 AM »

Quote
Wow!  That is just what I was looking for!  I thought this could only be done by switching rooms.  In fact, I remember reading somewhere someone said that using one big room is bad and that using small rooms and linking them together is best.
Bullocks. The only issue with using one large room is that you get too many objects active at once, etc. and things build up. But this is easily remedies using the instance_(de)activation functions. Fortunately, they are also quite easily to implement, so I can't really see any reason for using the multiple-room method for such a simple game.

Anyhow, good luck with that! I'm working on the computer full-time now, so I'll be around whenever you need help or have questions.
Logged
Randy
Level 0
***



View Profile WWW
« Reply #30 on: July 27, 2009, 06:17:43 PM »

The game so far...

It's been a while and so I've decided to come back and show what I've been doing.  I've created the whole world, placed all the hearts, made it so there are rock barriers that disappear when you've collected all the hearts.  I've made a sprite of my wife and some island animals.

What I need now is some music, sounds and a title screen and ending screen.  So feel to try it out and give feed back.  I do plan on putting some motion in the sore line and some sparkles in the water to make it seem more alive.

Here are some screen shots.





Here are the files...

Game Maker File

Game exe

Oh!  Does anyone know of a good free sound library for game sounds and music?
Logged
Rostiger
Pixelhead
Level 5
******



View Profile WWW
« Reply #31 on: July 29, 2009, 02:02:56 PM »

My, that is really cute.

Here's some feedback and suggestions:

On my computer, the game looks like this. This seems to be the notorious glitch of Game Maker handling scaled tiles. Fortunately, Mr.Ray has like usually a great solution.

Make sure to lead the way at the beginning to the very right. There are two hearts and the player sees your girl on the other island. This gives a distinctive goal prevents missing the two hearts and realizing it when already at the very end (except if you intended it that way). Smiley

Also I would love to see this come to life a little bit more. You already mentioned the animated water, but adding nice little touches like the gulls take off upon aproaching, or hiding some hearts in treasure chests or other small things like that would really put the cream ontop! But that's really only nitpicking.

Other than that it's really a sweet idea, I'm sure she's going to love it.

Concerning the sound effects, I think SFXR should do you pretty good.
There are also some talented music people around here, I'm sure someone will be able to help you out.

Good luck!  Beer!
« Last Edit: July 29, 2009, 02:06:43 PM by Rostiger » Logged

Clemens Scott
Co-Founder & Artist of Broken Rules
Randy
Level 0
***



View Profile WWW
« Reply #32 on: August 12, 2009, 04:44:27 AM »

IT'S DONE!!!



I've made a thread about it in the Feedback area.

Here's the Game Maker file for those that wish to see it.

GAME MAKER FILE HERE
GAME EXE HERE

I want to thank ChevyRay for all his help on this.  I can honestly say it wouldn't have gotten done with out him.  I also want to thank Compound for all his help with the music.  I wasn't sure how I was going to get that done so his music skills where a huge asset to me.  Thanks guys ^_^

In the end I'm very happy with it.  It would have been nice if I could compress it a bit so it wasn't so big... but that kind of skill will come with time.

Thank you everyone for your support and feedback during this, my first project.  I hope and plan to do more in the future, maybe teaming up with some of the extremely talented people here.

Thanks again and enjoy. ^_^

Logged
ChevyRay
Guest
« Reply #33 on: August 12, 2009, 06:13:17 AM »

Rad deal! I'm downloading now, bro Grin
Logged
Pages: 1 [2]
Print
Jump to:  

Theme orange-lt created by panic