Jump to content

Skyflu

Game Owner
  • Posts

    2
  • Joined

  • Last visited

Recent Profile Visitors

1,340 profile views

Skyflu's Achievements

Newbie

Newbie (2/21)

0

Reputation

  1. I second python! Though I made a pet imaging program first in python and then learned how to recreate it online. I used Flask (it's a python web framework system), but now I'm converting it to Django (another python framework). So I'm using python for the back end and html as well as css for the front end. I'm having a lot of fun learning. Good luck!
  2. Hiya! I'm a beginner coder myself. I wanted to create my own pet generator imaging program, but I used python instead of javascript. I know it's not exactly what you're looking for, but maybe the concepts will be the same and it'll help you figure out an equivalent in js. So I created gene 'dictionaries'. Dictionaries allow for a key and a value paired up. In my code example, I currently have 5 primary genes listed in a dictionary like so primaryGene: { 1: 'basic', 2: 'tiger'... etc} If you're looking for the program to calculate children~ the user says mom has 'basic' and dad has 'tiger', then the program is set up to select a random number between 1 and 2 since 'basic' = 1 and 'tiger' =2. So say it picks 1 (this child takes after mom), then the 1 gets put back into the dictionary and outputs 'basic'. You create a function that holds this script so you can call it every time you want the program to pick the baby's genes. I also applied this same concept to my pet colors. I've created a library of 55 colors, each assigned a name and a RGB value. I'm an artist that's trying to learn how to code so I wanted to hand pick which colors I thought looked best. Anyways, I run the same code I mentioned before about getting mom and dad's inputs and randomly selecting a value within the set parent range. Having the dictionaries and selection code separate allows for you to edit the dictionaries without having it affect the function code itself... hopefully this makes sense. Again, I'm not a professional. I'm just doing this as a hobby and wanted to make my own pet thing, but hopefully this helped. If you'd like to mess around with what I've created, I made a test site here: http://skyflu.pythonanywhere.com/makekids It's a bit slow at calculating the children results because I have python actually coloring and processing the pet images. So it has to do that four times for each baby. I set it up with one template and let the code do all the work.
×
×
  • Create New...