Newbie (really) questions.

Talk about making games.

Newbie (really) questions.

Postby FERdeBOER » Sun Mar 14, 2010 11:07 pm

Hello all,

First, I have to say that I've spend all last week on knowing the program, reading tutorials and wandering around the forum to gather as much information as I could in order to be the less "PITA" possible, but there are some things I can't resolve for myself. Probably most of them are very easy and I might have had the solution in front of me, but I couldn't see it. :oops:
I tried looking demos of games that use the solutions I need, but I'm not very good at the moment on "reverse engineering" with this program.
About scripting... my little experience on this kind of things is python, so I understand the basics, but no more.

Probably the best thing is to make a short brief about my game so you can understand better what I'm looking for:
The idea is to create a photographic safari consisting on 3 screens:
- the first one will be the positioning: the player has to approach the animals with his vehicle but must not do it from certain parts and not too fast.

- the second screen will appear when the vehicle is on the right position and is the photographic part itself. The animals will appear without warning and the player has to make the photo on that precise moment.

- the third (and last) screen will be the vision of the photos made.
Of course there will be an intro and transition scenes.

My questions (for now) are:

- On the first screen, How can I create actors on random points? I need to do that both for animals (create one animal among a selection of them and make it appear on a random point of the screen) and for the scenery elements that will give movement sensation to the game.

- On the second screen my problem is similar, I need the animal "created" on the first one to appear randomly on the screen. (In this case I don't need the animal to appear on a random point).
I would need also to make the photos, so I will draw an square simulating the camera's lens and make the photo when pressing a certain key. How can I do that?

- The third screen will show the photos, so I would need to know how to make the photo on this screen and make it appear on the third one.
I saw on this demo viewtopic.php?f=6&t=7365 that is possible to do that, but I can't understand how the author did it.

The rest is already done or I know how to do it (I hope).
I hope to have had been clear enough with my questions (I'm Spanish) and not bore you.

Forgive me again if my questions are too simple/easy/silly. :oops:

Thank You very much for your time,

FERdeBOER.
FERdeBOER
 
Posts: 36
Joined: Fri Mar 12, 2010 8:03 pm
Location: Good question...
Score: 0 Give a positive score

Re: Newbie (really) questions.

Postby FERdeBOER » Tue Mar 16, 2010 10:29 am

Ok, I found the solution for the random time appearance on the second screen.
The timer option has a random option in it I didn't see before :?

What I can't find is the way of random position appearance. I suppose I have to do it by scripting, but my C knowledge is null...

I tried this based on what I found on a tutorial but didn't work:
CreateActor("animal", "animal", "no parent", "no path", rand(view.width, view.width) false);

What am I doing wrong? Any suggestions?

About the photos thing, I've created a workaround in which on the third screen the photos will be "fake". I've made it with collision events on the second screen.

Thanks again.
FERdeBOER
 
Posts: 36
Joined: Fri Mar 12, 2010 8:03 pm
Location: Good question...
Score: 0 Give a positive score

Re: Newbie (really) questions.

Postby thunderios » Tue Mar 16, 2010 2:50 pm

Does rand() have two arguments? I suppose you'd write it like
Code: Select all
CreateActor("animal", "animal", "no parent", "no path", rand(view.width), rand(view.height), false);

Maybe this game is a little far-fetched for your first game, but I'll still try to help you ;D

1. Animals must be looking at a certain angle, which should correlate with their animation. If you know the angle just say
Code: Select all
if (tan(pow(Player.x - Animal.x, 2)/pow(Player.y - Animal.y, 2) - 20 > Animal.angle ||  tan(pow(Player.x - Animal.x, 2)/pow(Player.y - Animal.y, 2) + 20 < Animal.angle || Player.directional_velocity > MaxSpeed)
{
    // either destroy the animal or do whatever they'd do in real life
}
thunderios
 
Posts: 87
Joined: Thu Jan 31, 2008 1:18 pm
Score: 1 Give a positive score

Re: Newbie (really) questions.

Postby FERdeBOER » Tue Mar 16, 2010 3:23 pm

Thank you very much thunderios.

I've found the solution on a demo just before your answer and yes, you're right, I missed one rand.
I also were committing another mistake by doing this with a Create Actor action despite of Draw Actor one :roll:
Now it works just as I wanted it to.

The second part is far too complicated for me, I don't even understand where are you pointing me at :oops:
Besides, if I understood you, no, I don't need the animals looking at a certain angle, they will be always looking at the same direction. (I'm not so ambitious :wink: )

Thanks again!
FERdeBOER
 
Posts: 36
Joined: Fri Mar 12, 2010 8:03 pm
Location: Good question...
Score: 0 Give a positive score


Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest