Need some help with game logic for turn based game

Get help using Construct 2

Post » Tue Nov 20, 2012 5:06 pm

Hey, I'm trying to make a space puzzle game. This is my first game using this engine. Here's a write up:
In this game the player and computer take turns. The game takes place on a 5x6 grid. The game starts with the CPU. Every CPU turn, 3 enemies will spawn at the top row and existing enemies will move 1 row down. On the players turn, the player can choose as many of the 5 columns to set up their turrets, the player starts with 5, one for each column. Firing a turret takes 1 ammo, the player starts with 5, the turret will fire after the CPU's turn and before the players next turn. After firing, 1 ammo will appear in the column fired at the top row. Turrets can also be used to defend the player against CPU units that will reach the player (last row) on it's turn, upon being destroyed the turret will take 1 turn to be repaired. The turrets are chained to the columns, so a player will not be able to fire down a column if that turret is destroyed. If a player cannot or does not defend themselves their ship will take 1 damage, the player starts with 3 life points. Once a player reaches 0 life points, the game ends. There will be a few different enemies, they will move down the grid differently. The player has to think of the best way to destroy enemies while managing their ammo and turrets. The players high score is based on how many turns a player lasts.

Here is a drawing to better understand: http://img853.imageshack.us/img853/492/201211042122031.jpg

I haven't implemented everything yet.
But I think I'm missing how some of the logic on conditions and actions work.

Here's the file: https://www.dropbox.com/s/bjme7d0krxxrh2p/space%20puzzler%20mock%20up.capx

I will be able to post more on how the functions/groups are supposed to work later tonight if need be.

Any help is much appreciated! I think I might be asking for too much.
B
3
Posts: 3
Reputation: 281

Post » Tue Nov 20, 2012 7:49 pm

Is there any way to print variables (and arrays) to a textbox or visual field? I believe this would greatly help with finding where the logic is breaking.

I've tried setting a textbox value to the variable. But it just shows up blank. Is this not how to do it or am I printing NULL?

edit: was using text box instead of text. fixed that and found the cast int to string operation. is this a good way to go about debugging? levelplane2012-11-20 20:48:40
B
3
Posts: 3
Reputation: 281

Post » Tue Nov 20, 2012 10:27 pm

Using the Text object is a great way to debug, although you'll generally want to keep tabs on as many variables as possible, so it can get cluttered quickly if you don't organize.

It looks like your game logic is easy to code, so you'll probably get it running by yourself.

B
19
S
5
G
1
Posts: 104
Reputation: 2,920

Post » Tue Nov 20, 2012 10:36 pm

Bleh, don't use text objects. Instead I highly recommend using the chrome console plugin.boolean2012-11-20 22:36:29
B
24
S
4
G
1
Posts: 244
Reputation: 3,462

Post » Wed Nov 21, 2012 8:40 pm

Thanks for the replies!
That chrome console plugin is a sweet piece. Your array addition is great.
Makes it loads easier to see whats going on and what conditions I misinterpreted.
Seems I'm not drawing stuff correctly. I'm putting in some more time figuring it out.
I'll put future troubles in this thread.
Edit: Didn't have a spawn point. Drawing stuff fixed! :)levelplane2012-11-21 20:58:12
B
3
Posts: 3
Reputation: 281


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 10 guests