early stages of a game

Talk about making games.

early stages of a game

Postby Morpheas » Thu Feb 23, 2012 10:11 am

screenshot.gif

Hi.
My first game is in the making. :)
not named yet
download the 3 attachments of test.part01-03.rar below

thx to skydereign for help with the coding.

many features missing :)
and many fixes must be done :)
tell me ur opinion for the graphics so far.
Attachments
test.part03.rar
(243.5 KiB) Downloaded 89 times
test.part02.rar
(1 MiB) Downloaded 91 times
test.part01.rar
(1 MiB) Downloaded 80 times
Morpheas
 
Posts: 17
Joined: Mon Feb 20, 2012 12:58 pm
Score: 1 Give a positive score

Re: early stages of a game

Postby Morpheas » Thu Feb 23, 2012 4:12 pm

does any1 knows how does GE computes which part of the animation position is the place where all the code goes?
is it the middle of the pic. or something else ?
ex. lets say u put an actor with many pics for animation like my cannon see photo above.
is there a way to tell an actor to follow the end of the barrel muzzle whatever the rotation?
Morpheas
 
Posts: 17
Joined: Mon Feb 20, 2012 12:58 pm
Score: 1 Give a positive score

Re: early stages of a game

Postby JamesLeonardo32 » Thu Feb 23, 2012 4:25 pm

Morpheas wrote:does any1 knows how does GE computes which part of the animation position is the place where all the code goes?
is it the middle of the pic. or something else ?
ex. lets say u put an actor with many pics for animation like my cannon see photo above.
is there a way to tell an actor to follow the end of the barrel muzzle whatever the rotation?

I may have read wrong but the code you may need is "animpos" which tells the animation position.
example:
Code: Select all
animpos=1;//number=frame


I'll have a go shortly, and welcome to GE Game making ;)

+Point
JamesLeonardo32
 
Posts: 320
Joined: Wed Oct 13, 2010 4:57 pm
Score: 36 Give a positive score

Re: early stages of a game

Postby Morpheas » Thu Feb 23, 2012 5:00 pm

i mean in the cannon ex. the coding by default goes to the base of the barrel and a little lower. is there a way to tell that point to change and follow the barrel's end?
i hope u understand me:P
English is not my native language
thx for the point
Morpheas
 
Posts: 17
Joined: Mon Feb 20, 2012 12:58 pm
Score: 1 Give a positive score

Re: early stages of a game

Postby skydereign » Thu Feb 23, 2012 9:15 pm

The xy position of any normal actor is the center of it. Since you are using a rotating actor you can use trig to determine the position of the end of the barrel.
Code: Select all
int end_x = cannon.x + cos(degtorad(direction(cannon.xscreen, cannon.yscreen, xmouse, ymouse)))*30; // 30 is the radius (most likely can be width)
int end_y = cannon.y - sin(degtorad(direction(cannon.xscreen, cannon.yscreen, xmouse, ymouse)))*30; // 30 could be width

// now end_x and end_y is the position of the end of the barrel
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: early stages of a game

Postby Morpheas » Fri Feb 24, 2012 3:02 pm

a little more explaining pls i didn't understand where to put it or what to do. all:P
do i declare it as a global variable?:)and then what?
sorry if im getting tiring...
thx for your patience.
Morpheas
 
Posts: 17
Joined: Mon Feb 20, 2012 12:58 pm
Score: 1 Give a positive score

Re: early stages of a game

Postby skydereign » Fri Feb 24, 2012 8:08 pm

That just showed the math to find the position of the end of the barrel. Those coordinates are the end of the barrel, here it is applied.
Attachments
test1.ged
(2.39 KiB) Downloaded 93 times
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score


Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest