Tutorial On Creation

A place for tutorials on how to get the most out of Flash

Tutorial On Creation

Postby Silver » Mon Jul 04, 2016 11:20 pm

Hey, guys, I'm planning a flash game porn parody, and need some help. Where do I start in programming? I've only ever used RPG Maker, and I want to make a game that plays like that one Dirtyc101 Legend of Krystal, where you have to find the master sword. The game would play a bit like that one, a quick punch, strong kick(probably not a kick), and a grapple. The main difference is, you'll be playing as the guy banging the women enemies. So, where do I start? I don't expect the game to be done anytime soon, or, even ready to release a small portion(stuff going on in personal life), but I want to learn as soon as possible, that way once I can sit down and work, I won't have to take up time learning.
My Main Questions:
How do I make a beat em up in Flash?(This one I can google easily, but I'm more looking for tips that I wouldn't commonly find)
How do I make in-game and scripted sex-scenes in Flash?
How do I make removable clothes from the character models? Just make them fade out and fade back in when necessary?
Thank you all so much!
Silver
Newly Registered
 
Joined: Sat Dec 05, 2015 6:55 pm

Re: Tutorial On Creation

Postby Enkide » Tue Jul 05, 2016 1:57 am

Which one was his? I don't think I saw that one.
User avatar
Enkide
 
Joined: Thu Aug 14, 2014 3:36 pm

Re: Tutorial On Creation

Postby ANooB » Tue Jul 05, 2016 2:16 am

I'd say pick up a mentor, bro. The best way to learn coding is to get in there and start tinkering with it. And you're gonna need someone there to look at it and help you. Otherwise debugging will drive you mad and you'll not wanna do it anymore. For starters, learn what a boolean is and how it's used in logic.

A boolean value is something that is true or false. is it true that the light is switched on, is it true that x+5 is equal to 10, or is it true that 10 is less than Y? The way you find out is by declaring things like variables. Let's declare a few, and find out what's true and what isn't just like a flash program will do. Alright, let's first check the light situation:
Code: Select All Code
public var lightsOn:Boolean=false;

Now just ignore the public and :Boolean, for now as they are complicated and actually are not necessary for our intent, anyways. Now if I were to ask flash if the light in your room was on? How do you do that, you're thinking, it's quite simple really. We do that with an if statement. These statements are fundamental to any logical operation and should be the first maneuver you learn in your journey. So let's go ahead and try it out:
Code: Select All Code
if(lightsOn){
runSomeFunction();
}

In code I'm telling flash to evaluate if the light is on. It's gonna look at the value we put in the parentheses (lightsOn) and if it's true, it'll run a made up function we've called runSomeFunction(). If it's false, nothing will happen. Now what do you think it will do?

Spoiler (click to show/hide):

Nothing will happen because in that first line of code, we said lightsOn was false, remember?


If you guessed correctly, then you're on your way to becoming a fine coder. :)

So let's go ahead and answer all those rhetorical questions I asked you before: are the lights on? is x+5=10? and is 10 less than Y?:
Code: Select All Code
//these double slashes indicate stuff you want flash to ignore, purely for coders like us to read
//anyways, let's declare some variables, we'll call them... lightsOn, x, and Y.
var lightsOn=true;
var x=5;
var Y=x+5;//remember, we said x is 5 up there, so this is just like saying 5+5

that wasn't too hard, right? just 3 lines of code. Now right under that we're gonna tell Flash to check each variable. If it's true, let's run a program that makes a yelp sound. so right under your vars let's put some if statements:

Code: Select All Code
if(lightsOn==true){
/*Oh yeah, when we test booleans, we use equal equal, so that flash doesn't think we're declaring it true like in the code above. Strange you say? there're times when flash uses equal equal equal(===), but those are rare and when working with Numbers like 1.0000045 and integers like 1, which all of us would agree are equal;
*/ anyways, back to the yelping...
yelp();
}
if(x+5==10){
yelp();
}
if(Y<10){
yelp();
}


How many yelps will flash do?

Spoiler (click to show/hide):

2


Did you get it right??? AWESOME! If you didn't, let's go ahead and evaluate why.

Spoiler (click to show/hide):

we said lightsOn is equal to true up there, x is equal to 5 so 5+5 does indeed == 10, and Y? well that one was a little tricky, because we technically said y was equal to 5+5. Yeah 5+5 equals 10, but 10 is not less than 10, it's equal equal to it.


So yeah, that's why flash yelped. Now there are other cool techniques you can use for evaluating, like checking if something is not true using an explanation: if(!lightsOn){}
if you wanna test multiple variables just use AND or OR, (indicated in code by &&(And) or || (Or)).

Lastly, when comparing numbers, sometimes it's better to include your max or minimum. Case in point, 100 <100 is false, but 100<=(less than or equal to)100 is true.
Let's try it out:

Code: Select All Code
if(!lightsOn){
yelp()
}
if(x+5==10 || Y<=10){
yelp();
}


Now it doesn't take a steven hawking to determine that you'll hear both yelps this time. Now I had fun, I hope you did, too. next lesson we'll go over What happens when you run an if statement that wasn't true, but still wanted some code to run. Next chapter, we discuss else
Spruce your games up using free vector content: viewtopic.php?f=45&t=7109

There're no such things as mistakes, just happy little accidents. ~Bob Ross
User avatar
ANooB
 
Joined: Mon Aug 09, 2010 12:58 am

Re: Tutorial On Creation

Postby GoRepeat » Tue Jul 05, 2016 8:44 pm

Look up tutorials on event Listeners and walk through some of them until you get how the concept works; those are going to drive the majority of your action in AS3 (game ticks, mouse input, keyboard input, etc).
Another good tutorial would be one on movie clip nesting and parent/child/root references; your character is actually going to be an empty "shell" that you hold various animations in (walking/running/attacking/sexing) so you need to know how to construct that in an object oriented process and how to reference/call your sub movie clips.
Other than that, just fiddle around and post here when you can't figure something out or get something to work.
Picarto LiveStream: https://picarto.tv/GoRepeat
Other Stuff: Click Here
User avatar
GoRepeat
Moderator
 
Joined: Wed Jul 21, 2010 2:26 am
Location: Behind the Looking Glass

Re: Tutorial On Creation

Postby Silver » Thu Jul 07, 2016 11:20 pm

Enkide Wrote:Which one was his? I don't think I saw that one.

Just search "dirtyc101" on e621, there's only two results, one of them is it.
Silver
Newly Registered
 
Joined: Sat Dec 05, 2015 6:55 pm


Return to Tutorials



Who is online

Users browsing this forum: No registered users