newb asking for some help ;)

Talk about making games.

newb asking for some help ;)

Postby trojan » Sun Jul 06, 2008 5:58 am

I had discovered GE only few days ago. Just when got some time I tried to create simple logical game. But I encountered many problems. Im not good in scripting. I would really apreciate some help.
I want to make tile based game:
(all pics are made only to show game concept)

1. At start of the game I want 12x12 tiles (20px x 20px) to be randomly generated from 6 actors. (green,yellow,red,blue,brown and black square). Like this:
Image

2. The player have to change one square with another(in turn) and then he will score if he succed in making (for example) 3 red squares to be in one line (horizontal or vertical). How to make script to check multiple direction with which object can collide?
example:
Image
Image

3. Now the 3 red squares will dissapear. And on their place new random squares will be created. The game goes on untill there isn't any posibility to score at one turn. How to make script which would check all possible moves and if no possibility to get 3 squares in a row occures would end game?

4. How to make "created actor" ingame (red_square; on key up "left"; create actor "red_square") to do same actions (like possibility to move) which original one had?

Sorry for my bad english.. I can only hope it is at least a bit understoodable in those not easy matters :roll:
I searched the forums to help myselve in game making but I failed to get answers I wanted to get. That's why I asked this 4 questions. Hope you can help me..

Regards Trojan.

PS. I wont be online in next 2-3 days cause I will be on a trip, so don't think I had resigned from game making if I wont repply to posts/thank for help in few days. ;)
trojan
 
Posts: 3
Joined: Thu May 01, 2008 3:24 am
Score: 0 Give a positive score

Re: newb asking for some help ;)

Postby Game A Gogo » Wed Jul 09, 2008 2:48 pm

I think you should move on to something less complicated then this :O
I have been programming for around 4 years, I don't think I could make that xD
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Re: newb asking for some help ;)

Postby DST » Wed Jul 09, 2008 3:31 pm

Well for starters, don't use six actors. It's much easier to use one actor, with a six-frame animation.
Make a variable called 'color', actor integer.
On piece> createactor:
ChangeAnimationDirection("Event Actor", STOPPED);
color=rand(6);
animpos=color;

Now you can refer to the color of the actor anytime to determine what it is.

This answers questions #1 and #4.

The other parts are much more complicated. If you still want to know, ask again, and I will tell you more.

I will tell you this: the secret to matching colors is an actor the shape of a plus sign. A piece can create the actor any time, and the arms of the actor extend to the four surrounding pieces, so the cross can ask for 'collide.color' to see if any of them match the original color.
It's easier to be clever than it is to be kind.
http://www.lostsynapse.com
http://www.dstgames.com
User avatar
DST
 
Posts: 1117
Joined: Sun Apr 15, 2007 5:36 pm
Location: 20 minutes into the future
Score: 151 Give a positive score

Re: newb asking for some help ;)

Postby trojan » Mon Jul 14, 2008 4:44 am

Thanks for help DST. (+)
Well it would be cool if you can answer for 2 and 3 question too. But ofc don't do it if you will have to waste to much time on it ;) it is not that important. But answers you gaved me made me get some new ideas :)
When I was waiting for answer I moved and tried to make space shooter game. Well I made ships (player_ship, enemy_ship), "shots" and explosions.And here comes:

5.Problem:
I made 3 png files to make animation of explosion from it (explosion000,explosion001,explosion002). I can see 3 frames animation in editor(actor control/animation) but not when I run game.. When I click game mode, only third (explosion002) frame is displayed. How to get all 3 frames ingame >:P

6.Problem:
I want to make enemies shoot in position of player_ship. When I try to use "move to" command. Bullet/laser is moving in player_ship position but it is stoping in the player_ship position. I got no clue how to make it move in same direction it was moving(I want shoots to move further in same line they were moving when they were "moving to"" player_ship location).

7. angles
hmm this just went on my mind when I was writing this post. How could I make graphic/actor turn for some angle. Like laser "-----" would automaticy get correct angle to hit player_ship. Then graphic would be turned for x angle and moved to player_ship.

Im so sleepy that I think this cannot be understood by any normal human being :oops: So won't type anything more..

Cheers Trojan.
trojan
 
Posts: 3
Joined: Thu May 01, 2008 3:24 am
Score: 0 Give a positive score

Re: newb asking for some help ;)

Postby DST » Mon Jul 14, 2008 1:35 pm

To shoot in the direction of player 1, don't use moveto, use this in the createactor for the bullet/laser:
angle=direction(x, y, player1.x, player1.y);
directional_velocity=8;

If you put the angle code in drawactor instead, the bullet will follow player1 (homing missile)

to turn a ship, you need several frames for the ship. Take the sprite maker beta here on the forum, use it to create a 72 frame animation for your ship (that's 5 degrees per frame, very smooth) Make sure that the first frame (the original file you started with) is at 0 degrees (facing right). Then load the animation, and in the ship's
creatactor use:
ChangeAnimationDirection("Event Actor", STOPPED);

Then in the drawactor:
animpos=angle/5;

Now the ship will face whatever direction it is heading.

Animation Problem: I suppose you have the animation set to destroy itself after finishing the explosion? On that destroy command, when you click ok, choose 'wait for frame action' and enter frame 0; That should make the animation play out properly.
It's easier to be clever than it is to be kind.
http://www.lostsynapse.com
http://www.dstgames.com
User avatar
DST
 
Posts: 1117
Joined: Sun Apr 15, 2007 5:36 pm
Location: 20 minutes into the future
Score: 151 Give a positive score

Re: newb asking for some help ;)

Postby trojan » Sun Jul 20, 2008 1:11 am

Thanks. Thats help alot. 8) +
trojan
 
Posts: 3
Joined: Thu May 01, 2008 3:24 am
Score: 0 Give a positive score


Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest