Pong clone

Get help using Construct 2

Post » Fri Sep 21, 2012 8:19 pm

I'm still here I just have to finish a few things here at work (deadlines), and talk to my boss so it will be a little while.

Do you want the background color to be that green color you have selected or a different color?
B
50
S
11
G
8
Posts: 479
Reputation: 9,911

Post » Fri Sep 21, 2012 8:22 pm

Green, as the paddles are white and the ball is black. I still can't figure out what's wrong with it. Take your time looking at it, I can't find anything to fix it so it's not like I'll fix it and you will have wasted your time.
B
4
Posts: 24
Reputation: 348

Post » Fri Sep 21, 2012 10:08 pm

Ok, The problems I found were just a few little mistakes but it is all working now. Here are the issues, and the steps taken to fix them:

1. The reason all you could see was white and the dummy puck is because you had the "Get Ready" Layer 3 set to transparent "No" in the properties window. This is a easy mistake to make. This probably happened when you thought you had the background layer selected, it happens. So layer 3 was blocking out all the layers beneath it. When working with C2 it is a good practice to do your background layer first, and lock it you can always unlock it if you need to make changes.

I set it to yes.

2. You had instance variables both Player_Score, and AI_Score set to your Paddle_AI. This wouldn't have worked, and was not needed since you already had global variables set properly.

I deleted both instance variables.

3. You had the Paddle_AI Set Y to Mouse.Y when it should have been your Player_Paddle. Easy mistake its like making a typo. This wouldn't have worked since the Paddle_AI is your AI (Artificial Intelligence), and is using lerp to move.

I changed it to Player_Paddle Set Y to Mouse.Y.

4. You had:

      +Puck->On collision with Player_EndZone
           -System->Wait 5.0 seconds

   When it should have been:

      +Puck->On collision with Player_EndZone
           -System->Wait 0.5 seconds

   Another easy typo type mistake.

5. After I got it all running good I noticed that your dummy ball, ball, and Play again button all had white backgrounds which just didn't look good.

So I exported your sprites, and got rid of the whit backgrounds with Photoshop. Then I replaced those sprites with the cleaned up ones, cropped, added image points to your ball, and re-sized the ball's to look good. I hope you don't mind.

Anyway here is your fixed .capx:

https://dl.dropbox.com/u/43763487/Pongboy/pong.capxWink2012-09-21 22:13:50
B
50
S
11
G
8
Posts: 479
Reputation: 9,911

Post » Fri Sep 21, 2012 10:21 pm

That's awesome, thanks. I would have preferred to be able to do the changes myself but at least you told me where I went wrong and how to fix them.
1) I thought that might have been the issue but I checked and it seemed like it wasn't doing anything wrong, or I thought if I set it to transparent it wouldn't show up at all, which is another problem.

2)I don't get is why you say the instance variables wouldn't have worked since I already had the global variables going. I put them in to match what you had set up in your version, as I recall them being essential for some events to take place..

3)I can't believe I overlooked that, much less typed it out and thought that made sense, which it doesn't.

4)At that point I was quite.. let's say annoyed so I guess I made that typo and overlooked it.

5)This wasn't so much a problem as I knew it would have looked quite scrappy, but I wasn't too concerned about it. I'm thankful you took the extra measure of cleaning them up for me, even if it's only a small course project. Not even that, it was just a "see if you can use this tool over the weekend, try to make a game if you can" type deal.

It's all very confusing and overwhelming, simple thing have a lot of working out to perform and there are so many ways you can make mistakes. If Construct had a way of suggesting where a problem is that's preventing an event from working the way it thinks you are trying to get it to work, then that would make construct 2 perfect.

I guess with more practice I'll get it working myself some time.

Thanks again.Pongboy2012-09-21 22:32:51
B
4
Posts: 24
Reputation: 348

Post » Fri Sep 21, 2012 10:45 pm

Your welcome :) Sorry about sending you the fixed .capx. You still could do it yourself just quit looking at it, and follow what I wrote, and how to fix it.

I had global variables set up , and so did you but you also had instance variables assigned to the Paddle_AI and they were Player_Score, and AI_Score. If you click on your Paddle_AI in the .capx you sent me you will see were you assigned them. For this method to work you would have had to assign Player_Score to the Player_Paddle, and AI_Score to the Paddle_AI.

A pong game with an AI is not as easy to build as some experienced C2 users might lead you to believe. it is actually a little more of an advanced game. Don't worry about being confused at first we were all there, and some of us still are :) I'm glad to here that this isn't going to be the only game your going to build with C2. I would recommend you try Ashley's Beginner's guide to Construct 2 tutorial when you have some time. It will help clear all the confusion.

I'm sure the Construct 2 suggesting where a problem is built in AI is on Ashley, and Toms list of things to do :D Just stick around and make some great games while your waiting.Wink2012-09-21 22:49:50
B
50
S
11
G
8
Posts: 479
Reputation: 9,911

Post » Mon Sep 24, 2012 10:30 am

I tried using the game after I copied it over to my memory stick, but it doesn;t function properly. The player paddle will go through both walls, following the cursor and neither score appears, possibly doesn't even update either. Also, the play again button doesn't appear, there's just a 3 second countdown until the game auto starts. The cursor also disappears when moved over the layout.

I haven't changed anything, so what's going wrong here?Pongboy2012-09-24 10:34:32
B
4
Posts: 24
Reputation: 348

Post » Tue Sep 25, 2012 3:33 pm

Hmm, I don't have a flash drive to try to recreate the problems with. I don't think running it off a flash drive would make a difference though.

Are you running the game on a different computer? If that is what is causing the problem you might want to make sure the other computers graphics drivers are up-to-date, and also make sure that the browser you are trying to run the game on is not IE8 or earlier. HTML 5 games wont run on older versions of IE very well if at all so if your Computers OS is XP, or Vista try installing the Chrome browser or Firefox. These are the only things that I can think of that might cause the problems your having running your game.   Wink2012-09-25 15:41:13
B
50
S
11
G
8
Posts: 479
Reputation: 9,911

Post » Thu Sep 27, 2012 9:58 pm

That might be it, the college computers use internet explorer 8 I think. I'll try it with chrome sometime, but I don't need to anymore. We have moved on to another project but I never really got this one done. He wants us to use the "Gamesalad" dev tool because it teaches us about instances or something, while I told him and showed him how much better Construct 2 is. He recognised this fact, but he said we are all already too far into using gamesalad, so a change over wouldn't be fair so the others. I think he doesn't mind what dev tool I use though, so Construct 2 all day everyday for me.
B
4
Posts: 24
Reputation: 348

Previous

Return to How do I....?

Who is online

Users browsing this forum: BipolarMike, Televangelist, totoe and 23 guests