I am Tookman, a high school student that doesn't have much experience coding games, but I have experience with just general coding, can someone give me the coding to a simple game so that I can study it to understand more about game coding?
yeah I figured it out package
{ import flash.display.Sprite; import flash.events.Event; import flash.events.KeyboardEvent; import flash.ui.Keyboard public class Main extends Sprite { private var aDown:Boolean = false; private var dDown:Boolean = false; private var sDown:Boolean = false; private var wDown:Boolean = false; private var char : player;
private var gDown:Boolean = false; private var jDown:Boolean = false; private var hDown:Boolean = false; private var yDown:Boolean = false; private var par : shark;
private var bar : Back;
public function Main():void {
bar = new Back(); bar.x = 0; bar.y = 0; addChild(bar);
I specifically designed THIS tutorial at your request. Right now it is incomplete but it does answer these questions. Adding img's to visualize the characters and how to use the game loop to create and move units. Right now you are on the second PART, but I still recommend following from the start as it covers the very beginning steps. Examples for both flash and flashDevelop.
um to be honest... all of it, all the flash I currently know is written in my program above so any words different from the ones in my program probably go right over my head. What is similar to "or" statements in flash?
Well... I find this strange as you have already done everything up to this point with your posted code in part 1 of the tutorial. Try spending more than 20 minutes reading.
Here is an example of statements, you have already been doing;
Ok weirdlike, I am not ready to use a blitting tool, I simply need to know whats wrong with this, when I get to the blitting tool step, I'll ask for some help... but first, what's wrong with this?
This code will randomly choose a number between 1 and 4.
then the randomized number will determine the exact placement, that you have chosen.
This is literally the second portion of PART 2 of the tutorial.
EDIT: if you scroll down to the bottom of each part, I have the source files there. You can download them and skim the code instead of reading the portions.
two questions:
1) is spawnblock a real word or do I have to define it as a variable?
2) Where do I put this new section of code to randomly spawn the speed boost?
The code will never execute unless there is a trigger or you specifically tell it to execute. In the purposes of the tutorial, the spawnBlock(); function is executed each frame.
NOTE: There should only be one EnterFrame loop. (Event.ENTER_FRAME, keys); is (Event.ENTER_FRAME, loop); in the tutorial. So either change the name and function or put all your looping code in the keys function.