Monster Racer Rush
Select between 5 monster racers, upgrade your monster skill and win the competition!
4.18 / 5.00 3,534 ViewsBuild and Base
Build most powerful forces, unleash hordes of monster and control your soldiers!
3.80 / 5.00 4,200 ViewsThe for loop in my suggestion only needs to be run once. The raindrops do the rest of the work after that.
This is what I have so far. use the arrow keys to move the red ball around. Amazing graphics, no?
I'm using Corey Oneal's Collision Detection Kit, and this is a modification of some of the example code. I need some help understanding the math behind this.
The walls seem to be pushing the ball away, this is most noticeable in the corners and in the pockets of the S curve in the upper left. Here's the code that I'm using:
public function Engine()
{
room = new simple_map()
room.x = 0;
room.y = 0;
theParent.addChild(room);
player = new hero();
player.x = 325;
player.y = 220;
xspeed = 0;
yspeed = 0;
mass = 2;
vx = 0;
vy = 0;
theParent.addChild(player);
//For CDK
//this sets the hit test between player and room.
collisions = new CollisionList(room);
collisions.addItem(player);
//senocular - controls
key = new KeyObject(stage);
addEventListener(Event.ENTER_FRAME, update);
}
private function update(e:Event):void
{
//controls
if (key.isDown(37)) {//left arrow
xspeed = -1.5;
}else if (key.isDown(39)) {//right arrow
xspeed = 1.5;
}else {
xspeed = 0;
}
if (key.isDown(38)) {//up arrow
yspeed = -1;
}else if (key.isDown(40)) {//down arrow
yspeed = 1;
}else {
yspeed = 0;
}
//collision
var coll:Array = collisions.checkCollisions();
var friction:Number = .75;
if (coll.length) {
//first item in array is the smallest object in the collision, the player
var heroObj:Object = coll[0];
//returns the angle of collision in radians
var angle:Number = heroObj.angle;
//returns array of pixels overlapping, in stage coordinates
var overlap:int = heroObj.overlapping.length;
var sin = Math.sin(angle);
var cos = Math.cos(angle);
var vx0:Number = vx * cos + vy * sin;
var vy0:Number = vy * cos - vx * sin;
//10000 represents the wall as immovable, mass is the player
vx0 = ((mass - 10000) * vx0) / (mass + 10000);
vx = vx0 * cos - vy0 * sin;
vy = vy0 * cos + vx0 * sin;
vx -= cos * (overlap/40) ;
vy -= sin * (overlap/40) ;
}
//movement
vx += xspeed;
vy += yspeed;
vx *= friction;
vy *= friction;
player.x += vx;
player.y += vy;
}
I'm not very good at trigonometry, could someone help me understand what is happening here, and figure out what is causing the strange bouncing?
Instead of constantly making new rain drops, how about making a set number (say 100) with a for loop. Then inside your raindrop, make it so that when it falls past the bottom of the stage, it returns to the top with a randomized x position?
HAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAH!
Wait... wait... I'm not done,
LolROFLharHarHAR!OMGThat's so fucking hilarious!
You have never smoked pot one single time in your life, and you know absolutely nothing about it.
I'm all for this, but I'm not sure how well it would go over. Nobody wants just an idea man.
For this to work, the writer would need to come up with an amazing design document, that goes down the list and gives descriptions for every level, item, special ability, and character in the game. The trick here is, writing descriptions that are going to be useful to graphic designer, programmer, and sound engineer alike. It would have to be much MUCH more than simply filling in the talk bubbles in an rpg. Really, the story is only going to be one small part of the overall doc anyway.
I also see the writer turning brainstorming sessions into coherent, easily understandable thought flows. After a good B.S., a writer could toss out all the bad ideas, and write out the good ideas into a doc update, then distribute them to the rest of the team.
I think we need a thread to hook up writers with programmers and artists. I don't think the people in this community are used to working with writers yet. But at the same time, I would definitely want to keep any docs I write private, and only post the general concept, and maybe a snippet, like a character description when I want to advertise it.
Of course, I would also like to hear from artists and programmers what exactly they would want in a design document. I want to know what would help them the most to make their parts.
Writers who can also voice act are going to have such an advantage here! Too bad I code...
Yes lol, all confusion is cleared up. You want an action script, with funny mute people, who have speaking parts. :P
All joking aside, I think you should animate my Dr. Suess anti-fan fiction, The Rat with a Bat :)
It was a quick example. Usually you wouldn't do something like that in that same class. But, if I have, say, a class called EnemyHandler that creates instances of another class Enemy then pushes them into an array, I'll set up event dispatches in Enemy that tells EnemyHandler when to remove them from the array:
public class EnemyHandler extends MovieClip
{
private var enemyList:Array;
public function EnemyHandler():void {
enemyList = [];
for (var i:int = 0; i < 10; i++) {
var myEnemy:Enemy = new Enemy();
myEnemy.addEventListener("EnemyDead", die); //EnemyDead dispatches from Enemy class
addChild(myEnemy);
enemyList.push(myEnemy);
}
}
private function die(e:Event):void
{
enemyList.splice(enemyList.indexOf(e.currentTarget),1);
}
}
"currentTarget" is a really powerful tool when dealing with events.
You might as well learn AS3 if you don't know a lot of AS2. When I made the switch I only had to relearn two things really, Events and event listeners, and that hitTest became hitTestObject/hitTestPoint.
What you're talking about, the 3 lines of code for a 1 line action, what you are most likely referring to are events. Pretty much instead of using just "on(ENTER_FRAME)" or however it's written in AS2, you would use 2 lines:
addEventListener(Event.ENTER_FRAME, update);
function update(e:Event):void{
}
But unlike AS2, you can also do custom events:
addEventListener("EnemyDeath", die);
if(health <=0){
dispatchEvent(New Event("EnemyDeath"));
}
function die(e:Event){
removeEnemy();
removeEventListener("EnemyDeath", die);
}
It's a few extra lines of code, but you can dispatch any kind of event yourself, even mouse clicks and key presses, at any time you want. This allows much more precise control of your game or program.
I think you're trying to say Timeline based, or class based coding. You can put all your code in the timeline and mc's timelines, or you can use class files to control everything a lot easier (imo).
If you want to just concentrate on art, why not try teaming up with a programmer? I'm sure that would work out best if you don't want to concentrate on code.
1. Go to your Windows desktop.
2. hit PRT SCR(print screen) on your keyboard
3. Click the stage in flash, and press control+V
The absolute most simple Windows flash, EVAR!
So, I'm guessing everyone needs an extension then?
At 5/14/10 05:21 PM, funkycaveman wrote:
Did you see it was not game-play artwork? I am not going to work on a whole level and then have no programmer to work on it, I put something together quickly just to help illustrate what the game may be like.
You might not want to put a ton of effort into this if you don't get a programmer, but you're not going to get a programmer unless you put more effort into you art. What you posted is nothing special, that can be drawn pretty easily by just about anyone. Whether that's the game art or not, it doesn't say much about your skills as an artist. No offense to you or anything, but you should post something else, something that is better than your first picture.
I'm making a map for a new game, and it's a fairly big map (2040x1320), so I'm doing it in photoshop, then I'm going to import it into Flash. What would be the best way to export a large file from photoshop for use in Flash?
I'm seeing that a few forums are saying to use .png, but I'm not going to be using any transparencies on the map, so I was thinking a high quality jpeg? Or will flash compression take care of it, no matter what I use?
Most of my characters are based off of people I know. This makes it a little easier with my writing, because if I get stuck, I can think, "What would so-and-so really do?" and get some inspiration.
I also get character ideas sometimes from background characters in tv shows, movies and books: The main character comes riding in on a dinosaur, shooting a flamethrower, and then presses a button on a remote control that blows up military base in the background. Awesome! But what about the guys you never saw on screen that had to sneak in and plant the explosives? They were probably just as bad ass, right? How about a team of guerrilla demolition experts as characters in a story?
That's just an example of the thought process I take.
You asked what's next, AS3 is what is next. You have CS3 and no excuse not to use it. Any reason you have for staying with AS2 is just going to be seen as laziness by anyone who knows AS3.
From the sounds of it, you don't know a lot of AS2 anyway, if all you can make is point and click games. So the only thing you would really need to relearn there is how to use event listeners and mouse events.
At 5/13/10 06:50 PM, Wolf-Raven wrote:
First of all, i like to point out that many of us writers are alcoholics. Given, i've been unfaithful to that creed because i haven't touched a drop for a while, but still. We deal with rejection all the time: Our stories, our lifestyles and our sexual advances are all subject to cutting it off at the balls.
Wut?
If your sexual advances aren't working, either put in more effort, or be less creepy. That's all on you buddy, not being a writer :P
As for being published: Why not start off small, with a blog or a website? Go nuts from there.
As for why "bad" books get popular: First, how many of you have picked up Twilight and read it, cover to cover at least once? I haven't. Is it a bad book? I honestly don't know. Why is it popular? FRANCHISING! You have seen Edwards face every where, from shirts and hilariously made girls underwear, to movie posters and dolls. Twilight was targeted at young and teenage girls, and was plastered, almostliterally, everywhere a young or teenage girl would look.
Of course it became popular. There was a lot of money spent to make it that way. Why was this particular story chosen? Vampires are sexy, the story itself isn't too sexy, and the opportunity/connections/friends to be able to make a multimillion dollar gamble were available. Twilight is just a successful example of this...
They tried to do the same thing with the Eregon book series, does anyone remember that? It was targeted at young and teenage boys, so there were a lot of action figures and video games. The book series was pretty meh, I read it. But the movie was awful! They made the same multimillion dollar gamble, and flopped.
Harry Potter tho... That was a good book series, I liked it :) The first movie was pretty good too, I haven't seen any since the third tho. What was I talking about?
At 5/11/10 05:13 PM, HDXmike wrote: HYPER ANIME FLASHING SUPER RAINBOW COLOUR SEIZURE MODE !!!1!one
He was kidding, I am not:
DO THIS! DO THIS! DO THIS!
And then make it hard to get :)
Or... different colors for different power ups maybe? Or the player has to be a certain color to unlock a door, puzzle style? Tell us about your game.
And I like 8 if I have to chose just one, altho... we don't really have enough red game heroes...
Ah ok. It was this line in particular:
"Monolith that with the power of the natural wind could give electricity to the whole Fair for a day"
I pretty much read that like: The monolith used wind to make electricity. So I got confused when the next line said it was releasing smoke clouds :)
You guys are getting way off topic here.
If you're talking about making a macro program in AS3 that can left click outside of a flash window, then no, you can't do that.
If you're talking about clicking inside your flash app, go read up on addEventListener and MouseEvent.Click.
From Curtis Morley's site:
"This error basically means that you are trying to reference something that isn't there yet."
If debug is saying that the error is in those lines, check and make sure that "mc_bg" is actually there before you try to use "mc_bg.width."
I'm saying to check mc_bg, because it looks like "monster" is added properly and shouldn't be giving you a 1009, that just leaves mc_bg. So try using some trace statements in different places:
function createMonsters(event:TimerEvent):void
{
var monster:MovieClip;
monster = new Monster();
trace(mc_bg) //<--- tell us what this outputs!
monster.x = Math.random() * mc_bg.width;
monster.y = Math.random() * mc_bg.height;
container_mc.addChild(monster);
}
That should trace something to your output window that says "[object]" or something similar. If it doesn't that means that mc_bg isn't available.
I kind of understated it, you really nailed it!
To be honest, I think you should try a script, and see if you can get someone to animate it, but then again, I just got a new mic and have been waiting for a good script to come buy to practice voice acting on ha ha! Can't wait to see where you go with this :)
Well, why don't you post something? We'll read it and give you a few pointers.
Just do us a favor and make sure you are separating your paragraphs with a line, otherwise it will be hard to read.
I'm trying to test a movie, but my code has an error in it. Normally this isn't a big deal, but this time my compiler error window isn't showing me anything. Along the bottom it says: Total ActionScript Errors: 1, Reported Errors: 1. But the error is not showing up in the compiler error window. I've tried test movie, and debug (ctrl+shift+enter) but neither one tells me the error.
Does anyone have a guess as to what is causing this?
Never mind, I should look before I post.
try this:
function createMonsters(event:TimerEvent):void
{
var monster:MovieClip;
monster = new Monster();
monster.x = Math.random() * container_mc.width; //change here
monster.y = Math.random() * container_mc.height; //and here
container_mc.addChild(monster);
}
Do you know the actual number of pixels that your MC is? you could try just hand coding that in, instead of using stageWidth ect.:
monster.x = Math.random() * 200;
monster.y = Math.random() * 300;
if you need a border or margin:
monster.x = (Math.random()*180)+10 //if the screen is 200px the monster will only spawn between 10 and 190
But without knowing more, I can't really offer any other solution.
A few different background elements I have are 8 frames long with a a different drawing on each frame. This function is to make sure that no two MCs display the same thing at the same time.
Oops! Good catch, that was the problem!
if(rnum==n)
output:
1, 3, 8, 2, 5, 6, 4, 1, 7, 8, 2, 5, 4, 1, 6, 3, 8, 5, 4, 2, 7, 6, 3, 5, 4, 1, 2, 7, 8, 3, 6
I thought about using 2 arrays and switching used numbers and available numbers between them, but this way looked a little simpler, plus it only uses one array. It's probably not as efficient, but in my game I'm only using this function about 5-6 times a minute, not every frame like I was testing it, so this will work nicely.
Doesn't everything in do{} get run at least once before it makes a check? If the wrong number is generated, that's the only time I want the loop to run, if it comes up with the right number on the first try, I don't want to eat up CPU.
This is the first time I've tried setting up a do/while loop.
I wrote a function that generates a random number from 1-8, that is different from the last 5 numbers it generated. Or, at least that's what it's supposed to do. When I set up an enter frame event listener with a trace, what this function outputs is this:
7, 4, 3, 8, 1, 6, 4, 7, 3, 4, 7, 3, 2,8, 6, 6, 5, 8, 7, 8, 8, 7, 6, 5, 5, 6, 2, 8, 4, 5, 1, 7, 6, 2, 8, 3, 3, 2, 8, 6, 4, 2, 8, 2, 1, 6, 3, 3, 7, 8, 3, 5, 1, 4, 6, 3, 8, 7, 4, 5, 7, 4, 8, 2, 1, 2, 4, 7, 4, 6, 4, 6, 2, 6, 5, 3, 4, 7, 2, 5, 3, 7, 2, 1, 5, 6, 7, 2, 1, 3, 4, 7, 8, 6, 4, 3, 2, 1, 7, 6, 6, 6, 8, 1, 5, 4, 3, 6, 8, 4, 3, 5, 7, 4, 5, 8, 7, 2, 3, 5, 1, 4, 6, 8, 4, 6, 7, 5, 4, 5, 2, 8, 4, 6, 1, 6, 1, 7, 4, 2, 8, 2, 1, 6, 6, 3, 3, 2, 1, 6, 6, 4, 8, 4, 8, 7, 3, 2, 1, 5, 5, 7, 6, 1, 4, 3, 7, 2, 6, 5, 4, 7, 2, 7
All the numbers in bold shouldn't have been generated.
I'm not sure what is wrong with my code, I'm not getting any errors, I'm just not getting the numbers I want. Code some one take a look?
//my number generating function:
public function numberGen():int {
var rNum:int;
var numOK:Boolean;
do {
rNum = Math.floor(Math.random() * 8) + 1;
numOK = true
for each(var n:int in numList) {
if (rNum == numList[n]) {
numOK = false;
}
}
}while (!numOK)
numList.push(rNum);
if (numList.length > 5) {
numList.splice(0, 1);
}
return rNum;
}
//my enter frame event handler:
private function mytrace(e:Event):void
{
var myNum:int = numberGen();
trace(myNum);
}
I'm not really sure what's happening here, is it possible that numberGen() is being called too fast, not allowing the do/while loop to finish before generating a new number?