Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Having trouble with a game im trying to work on


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 EdinsonC   Members   -  Reputation: 258

Like
0Likes
Like

Posted 18 May 2014 - 03:54 PM

The game is scripted in python 3 and isn't much of a game yet but i've already ran into some trouble.

It is most probably something very simple, but i can't seem to wrap my head around it.

 

Here's the source code: http://www.mediafire.com/view/bzkw3hkncufnb7o/Catch.py

 

Now i'll tell you what the source code is supposed to do and what it doesn't:
 

The code is supposed to store "boards" for different levels in a list so that i can later fetch those boards when needed.

The fist function defined if "fetchNewBoard" which i would call whenever the levels change.

This function is supposed to check what level the player is up to and depending on that give the according "board" and stats (such as the edges of the board and stuff because some boards will be bigger.)

Then the "board" is returned as the "gameBoard" which is printed to the screen in the "showBoard" function.

 

It seems the code works fine, it prints the board to the screen (but not the players), however the players are given a random role and all, but i messed around a bit (bad idea) and i messed it up even more, now when i give input to move a player the game changes their roles LOL. 

 

The problem is definitely above line 78 and i think the main problem i'm having is the board not updating right. Before attempting to implement this idea of the "fetchNewLevel" function i had the game playing smoothly with everything working as it was supposed to. But back then i had the board printed in the "showBoad" function; like the string of the board was in the print() and not a variable. I'm guessing it's becase the variable is storing the board it got but the board inside the variable isn't being updated when the "cells" are changed (when the player changes position). However, i figured i'd get someone to help me and explain what i'm doing wrong before i mess the code up more LOL.

 

Thanks


“Everybody is a genius. But if you judge a fish by its ability to climb a tree, it will live its whole life believing that it is stupid.” -Albert Einstein

Sponsor:

#2 L. Spiro   Crossbones+   -  Reputation: 18995

Like
0Likes
Like

Posted 18 May 2014 - 09:11 PM

MediaFire tries to tell me my browser is old and I should “upgrade” to the one of their choice—a scare tactic I morally appose—and I will not view the file there.

Why don’t you just post the code here if it is not too long? If it is definitely above line 78, why not post the first 78 lines?


L. Spiro

Edited by L. Spiro, 18 May 2014 - 09:12 PM.


#3 Vortez   Crossbones+   -  Reputation: 2705

Like
0Likes
Like

Posted 18 May 2014 - 10:32 PM

There's also pastebin and pasteofcode



#4 TorbenC   Members   -  Reputation: 307

Like
0Likes
Like

Posted 18 May 2014 - 10:42 PM

MediaFire tries to tell me my browser is old and I should “upgrade” to the one of their choice—a scare tactic I morally appose—and I will not view the file there.

Why don’t you just post the code here if it is not too long? If it is definitely above line 78, why not post the first 78 lines?


L. Spiro

You don't use adblock do you?

 

Anyway, I agree with posting it on pastebin.



#5 EdinsonC   Members   -  Reputation: 258

Like
1Likes
Like

Posted 19 May 2014 - 05:37 AM

I figured put my problem ^_^


“Everybody is a genius. But if you judge a fish by its ability to climb a tree, it will live its whole life believing that it is stupid.” -Albert Einstein




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS