center click

Started by mattman26041, Tue 12/04/2005 20:42:51

Previous topic - Next topic

mattman26041

FIrst off (doesn't have to do with question) I would like to say 2 things. 1, I'm only 13 so this is why I'm asking so many questions. And 2, this is my first time working with ANYTHING like this so...

OK, the question.I've already made a short little game, but now I'm working on a medium-length game.It's going to be called "the sniper project". It's all going to be in a "sniper's look" (which I've already drawn),but my question is how can I make it so the "shot" come from the center of the crosshairs?????
"the sniper project" coming soon

Ishmael

Um... what do you exactly mean? What have you done so far, and what do you want it to do?
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

DoorKnobHandle

First off: I strongly recommend, that if you want to continue with a medium-length game, then start with an adventure, it's what AGS is made for!
To create those action-games or action-sequences, you just have to be an advanced programmer. Why not simply start with an adventure first? It is way easier, trust me!

Ok, still want to give you advice on your problem: That depends on what your shot is going to be, I mean there is not a shoot function in AGS, you'd probably have an object there, which plays a shooting animation and then you'd have to check if a player (an enemy) has been hit at the coordinates where the player aimed at and then cause damage.

But this stuff is more like a meal than a snack so I really encourage you - as mentioned above - to start with a simple adventure project - after all it's what AGS is made for and adventures can be great without action-sequences...

If you still want to continue with that stuff you can PM me for specific help - if I can find the time, I'll give you some advice on how to do those things...

mattman26041

ok, I've made the "sNipe" view (which will be the view i THINK the whole time), I'm working on the glass bottles for the first level, and What i want is when your move the snipe view around and click a "bullet" will come out of the center and line up with where the center crosshair is
"the sniper project" coming soon

mattman26041

Ok, [...]
I do think i still want to try it(for now unless it gets REALLY hard), but now I have a new question with that. HOw do you make it so the program KNOWS that it is lined up?
"the sniper project" coming soon

Ishmael

From the manual, see References -> Global Variables (or something like that, I don't remember 100% sure offhand), there are some usefull varialbes, especialy the mouse.x and mouse.y ones. Also, check the Text Script Commands section for hotspot and object functions.

As said, you need to have some programming knowledge to do this.
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

stuh505

QuoteWhat i want is when your move the snipe view around and click a "bullet" will come out of the center and line up with where the center crosshair is

Ok, in other words you want an image to move from one place to another place.

It seems like you know the coordinates you want it to come from, and you know the coordinates you want it to go to (mouse.x, mouse.y).

You can do this by moving a GraphicOverlay, or moving an Object, or moving a GUI Button, or moving a Character.  They all have pros and cons.

Overlays - Can be made dynamically, but can only have 10 overlays at a time
Objects - Cannot be made dynamically, if I recall correctly you can't change the room that they are in either but I could be wrong there
GUI Buttons - Can't use alpha channel, more confusing because it's not intuitive, and there is a limit on the number of GUI objects as well, and alpha channels on the GUI will affect the buttons
Character - Also unintuitive, must be made statically, but you can definitely change the rooms they are in.

A graphic overlay would be the most simple and intuitive method, it has some simple functions -- I won't list them, but you can easily look up GraphicOverlay in the help file in AGS. 

Good luck!

SMF spam blocked by CleanTalk