Jump to content
  • Advertisement

WinterDragon

Member
  • Content count

    36
  • Joined

  • Last visited

Community Reputation

156 Neutral

About WinterDragon

  • Rank
    Member

Personal Information

  • Website
  • Industry Role
    Animator
    Art Director
    Character Artist
    Concept Artist
    Creative Director
    Game Designer
    Producer
    Writer
  • Interests
    Art
    Business
    Design
    Production

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. WinterDragon

    an early coding exercise 1

    thanks for the tip, very useful. and thanks for reading.
  2. I wrote my first program (not including the false start last time I attempted programming) in Python... and it works! after a few bug fixes it's actually quite small and some would think insignificant. But I'm getting used to the syntax and form of the language. print ("hello") print ("nwhat are your 2 favourite foods of all time?") food1 = input ("nt1.") food2 = input ("nt2.") print ("I have made ",food2+food1," for you!") input ("press a key to exit and enjoy your meal :)")
  3. tip15 = 0 tip20 = 0 price = input ("how much did your meal cost?") tip15 = int (price) * .15 tip20 = int (price) * .2 print ("A 20% tip would be ",tip20," and a 15% tip would be",tip15) input () I wrote a tipper program for an exercise. It's a simple program and it took 20mins to write including several bug fixes, where I had to go back to looking through the textbook and a few glances at my first program, before I got it running properly. I made the usual noob mistakes - since I've tackled many different languages, I had to figure out if I needed to declare variables. I also got the variable on the wrong side of the equals sign, then I forgot to include commas in my print statement for the variables. I also forgot to state that the variable was an integer. Finally, I forgot to use brackets and then incorrectly included the calculation inside the brackets. Eventually, I figured all of this out and came up with the above seemingly simple program. And it works! I'm still not using comments, but I'll fix that when I start writing longer programs.
  4. carPrice = input ("what is the base price of the car?") tax = int (carPrice) * .125 insurance = 250 totalcarPrice = int (carPrice) + int (insurance) + int (tax) print ("total cost of your car including: insurance $",insurance,",") print ("and tax: $",tax," comes to $",totalcarPrice) input () This is a program that figures out all your extra costs, when buying a car. The only mistake I still need to figure out, is what the escape clause is for avoiding having a space at the end of a statement inside a print function. It works fine, the user enters the base cost for the car. Program calculates the tax and adds a previously decided insurance cost. Then the program provides the user with both the individual costs, and the total all-inclusive price of the car. EDIT: After some research not in-book, it turns out that you can avoid the white spaces in between statements by using the function sep = "", which should be treated as a variable - so not inside the quotation marks of the print function, rather, naked inside the brackets. So the final program now looks like this: carPrice = input ("what is the base price of the car?") tax = int (carPrice) * .125 insurance = 250 totalcarPrice = int (carPrice) + int (insurance) + int (tax) print ("total cost of your car including: insurance $",insurance,",", sep = "") print ("and tax: $",tax," comes to $",totalcarPrice, sep = "") input ()
  5. So it took one day to write and bug fix. Then another day to go through guesswork and figuring it out - to get the program to work. I haven't got up to while loops in the book, so it took a while - a few errors before I got it working. And I certainly haven't got as far as def methods, so using them was difficult and problematic. But I wanted my program to be complete with an exit option. import random def end_game(): end_message = ("game over") print (end_message) def game(): againPlay = "y" while againPlay == "y": nmCookie = random.randrange(5) begin = input ("cookie time, open your fortune cookie") if nmCookie < 1: print ("you are going to die someday") againPlay = input ("Still hungry") elif nmCookie == 1: print ("you just ate a cookie") againPlay = input ("Still hungry") elif nmCookie == 2: print ("you are going to eat another cookie") againPlay = input ("Still hungry") elif nmCookie == 3: print ("you like cookies") againPlay = input ("Still hungry") elif nmCookie == 4: print ("you will have a gargantuan legacy") againPlay = input ("Still hungry") else: end_game() game () end_game ()
  6. yea thanks that's all really helpful. I haven't actually got upto GUIs yet. so I guess there will be more about that when I do. I just ran the game, I'll have a look at the code now and it will give me more insight.
  7. WinterDragon

    n/a - no longer looking

    please delete
  8. I got the game to work after a few edits: but I still can't break out of the game. break initiates the error message "break outside loop" import random def end_game(): end_message = ("game over") print (end_message) def game(): nmCookie = random.randrange(5) begin = input ("cookie time, open your fortune cookie") if nmCookie < 1: print ("you are going to die someday") againPlay = input ("Still hungry") if againPlay != "Y" or againPLay != "y": end_game() game() elif nmCookie == 1: print ("you just ate a cookie") againPlay = input ("Still hungry") if againPlay != "Y" or againPLay != "y": end_game() game() elif nmCookie == 2: print ("you are going to eat another cookie") againPlay = input ("Still hungry") if againPlay != "Y" or againPLay != "y": end_game() game() elif nmCookie == 3: print ("you like cookies") againPlay = input ("Still hungry") if againPlay != "Y" or againPLay != "y": end_game() game() elif nmCookie == 4: print ("you will have a gargantuan legacy") againPlay = input ("Still hungry") if againPlay != "Y" or againPLay != "y": end_game() game() else: end_game() game()
  9. okay so I've taken a break from my adventure game to study up on my fundamentals - been working my way through my first python book goal = 60pgs/wk by crunching down and working through 60pgs in one day, 1day/wk and any exercises and fixing bugs + asking questions, etc. I got an assignment to create a fortune cookie simulator but I've only got a little bit of info about def methods. so I keep screwing them up. also I had to skip forward in the book (specifically from page 85 to page 356) to find out how to add a end_game feature which requires a def method. Problem is the idle processor says there are no bugs but when I run it nothing happens. first thought of course was I haven't told it to do anything because one of my lines made it skip the rest. but I don't think that's what's happening, because I have 5 loops and rand.range calls 5 numbers from 0-4. so that checks out I think. any clues as to why it might not be doing anything? my instinct says the problem is in the end_game method itself. import random def end_game(self): end_message = games.Message(value = "game over", size = 90, color = color.red, x = games.screen.width/2, y = games.screen.height/2, lifetime = 5 * games.screen.fps, after_death = games.screen.quit) games.screen.add(end_message) def game(): nmCookie = random.randrange(5) begin = input ("cookie time, open your fortune cookie") if nmCookie < 1: print ("you are going to die someday") againPlay = input ("Still hungry") if againPlay != "Y" or "y": end_game() game() elif nmCookie == 1: print ("you just ate a cookie") againPlay = input ("Still hungry") if againPlay != "Y" or "y": end_game() game() elif nmCookie == 2: print ("you are going to eat another cookie") againPlay = input ("Still hungry") if againPlay != "Y" or "y": end_game() game() elif nmCookie == 3: print ("you like cookies") againPlay = input ("Still hungry") if againPlay != "Y" or "y": end_game() game() elif nmCookie == 4: print ("you will have a gargantuan legacy") againPlay = input ("Still hungry") if againPlay != "Y" or "y": end_game() game() else: end_game() #added call game game () edit: solved it - forgot to call "game" #now it's telling me random not defined, but the book didn't tell me I needed to define random, am I missing something?
  10. pretty stoked that I got a 106 IQ (proficient - middle range) score in python on pluralsight, considering I'm just starting and think of myself as a beginner. The ranges are novice, proficient, expert. I expected to get a novice but compared to my peers I'm middle range. Which motivates me even more to keep going with python, I've also decided to get started with unity and eventually learn c++ for unreal engine. I know these goals are quite mountainous considering how much trouble I seem to be having so early on in the game. But I have overcome greater obstacles in the past, I think my goals are realistic and I'm optimistic. I also don't consider myself a coder yet, only a designer. If I can get to expert level IQ and finish a game (even a reverse engineered platform or arcade game) then I will be able to say I'm a coder, not simply that I'm learning to code. Thanks Alberth for your feedback that is all very helpful. I have a better understanding of what I'm doing now. Okay I'll have a go at reusing some of my code to build a smaller program. And then refine it so it works and works well. btw I use Idle because it came with python.
  11. it (the program) focuses alot on indentation, so I've been fixing that alot. man I miss line numbers. But anyway, I'm trying to take some of your advice and not rely so heavily on having the whole thing be under def methods, using while loops more, but I think I may need to go back to the book about the correct way to use while loops and define functions/methods? the problem I keep having is defining stats, then defining user interface, which seems to work, then I have the core of the program (which won't run because I haven't done the define and use method properly) - which is the if elif - choices and resource trading which are both in the same section and I need them both to work at the moment either they both work but don't loop properly ie the program runs but the loop doesn't go back to choices only lets you reenter your resource trading choice within the selected choice (ie 1, 2, 3, 4, 5) or I get error messages. error message: >>> t Traceback (most recent call last): File "<pyshell#2>", line 1, in <module> t NameError: name 't' is not defined the error I'm struggling with is it doesn't print anything on the screen when the program starts.
  12. still not working... I may have to hit the books again, or maybe you can explain what I've done and why it doesn't work? def stats(): again = "" buy = "" wallet = 30 attributes = {"Dexterity": 30, "Wisdom":30, "Health":30, "Strength":30} return again, buy, wallet, attributes def UI(again, buy, wallet, attributes): replay = input("Are you tough enough to play? y/n") again, buy, wallet, attributes = stats() while again != "n": print (attributes) print("1 = exit \n 2 = spend money on attributes \n for your character. \n 3 = sell an attribute. \n 4 = sell off an entire attribute. \n Choose a number from 1-4:") choices = {1, 2, 3, 4} choice = int(input ("what would you like to do?:")) if attributes == "": print("goodbye") else: while choice in choices: if choice == 1: print ("Goodbye") input ("press a key") elif choice == 2: #etc...
  13. MSVCR71.dll is the missing file. And thanks, yea I'll do that. I've got a bit of an idea of the different elements of the adventure game, so I'll have a go at writing, planning and coding them as separate programs before putting them together as a game.
  14. thanks that's massively helpful I'll take that on board as I move forward. so these are my first games to build (to do list) how does it look? text-based adventure Pong = Simple: input, physics, collision detection, sound; scoring Worm = Placement of random powerups, handling of screen boundaries, worm data structure Breakout = Lessons of pong, powerups, maps (brick arrangements) Missile Command = targeting; simple enemy ai, movement, and sound Space Invaders = simple movement for player and enemy, very similar to breakout with the exception that the enemy constantly moves downward, simple sound Asteroids = asteroids (enemies) and player can move in all directions, asteroids appear and move randomly, simple sound Tetris = block design, clearing the lines, scoring, simple animation Pac Man = simple animation, input, collision detection, maps (level design), ai Astro Warrior = top down view, enemy ai, powerups, scoring, collision detection, maps (level design), input, sound, boss ai Pit Pot Pro Wrestling (NES/Sega master system) Joust Gauntlet Dig Dug Rampage Gain Ground Ghostbusters (Sega Master System) Land of Illusion: starring Mickey Mouse = lessons of Astro Warrior (except with side-view instead of top-down view), acceleration, jumping, platforms Psycho Fox Alfred Chicken Kula World/Roll Away Marble Madness Streets of Rage Syphon Filter Skitchin Puzzle Pirates Mortal Kombat 1 close combat 1 Hell's Kitchen DS an original game So I'm sitting down to do my first day of writing my text-based adventure and I draw a blank. This is what I've written: "1. welcome the player 2. input from the player (last name) 3. return the value of first letter of last name and “Viggo.” " The game is called Viggo and his Quest. I want the player to be Viggo and I'm thematically basing it on the pub scene in Fellowship of the Ring which reminds me of a classic D&D adventure scenario. You go to a tavern and meet a shadowy figure who sends you on a quest. I want to make use of resource trading and combat. But I don't want it to be a really long game I just want to have a finished text adventure which I can share and which teaches me how to code a small game. - this is what I need to think about. so what's your process when you're writing a design doc for a concept that you haven't really developed and then writing pseudocode. Or do I need to write the adventure before I write the game? Just trying to get past the 'fear of the blank page" - which could be a game in itself. Update: 10 mins later: 4. “You are sitting in the tavern nursing your whiskey, when three hobbits sit down at your table and try to start a conversation with you. What do you do?” 5. input “kill the hobbitses”, “tell them to shut up, then introduce yourself”, “walk away” Update: another 10mins later: so this is what I have so far: 1. define methods: battle, shop, quest 2. welcome the player 3. input from the player (last name) 4. return the value of first letter of last name and “Viggo” 5. “You are sitting in the tavern nursing your whiskey, when three hobbits sit down at your table and try to start a conversation with you. What do you do?” 6. input “kill the hobbitses”, “tell them to shut up, then introduce yourself”, “walk away” 7. if kill the hobbitses go to battle method 8. battle method: a. define attribute/resource variables b. define player and npc characters now it starts getting complicated...
  15. wow you guys are great! thanks! I'm learning alot, I think I'm actually learning faster by asking for help than I have been just trying to crunch with the books by myself. by the way I downloaded py2exe but it won't load it says there is a dll file missing, did I put it in the wrong place or is it just a faulty file that I downloaded or the wrong file - it may be the wrong file as my pc is a 64bit os and I accidentally downloaded the 32bit version, I don't know if that's why it won't work?
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!