Home Tutorials Forums Articles Blogs Movies Library Employment Press
Prev Previous Post   Next Post Next
Old 03-03-2003, 09:12 PM   #1
Registered User
Join Date: Feb 2003
Location: In cyber-reality
Posts: 10
Angry part of game not working....

Can someone familiar with actionscript please tell me what's wrong with this codes:

ActionScript Code:
function moveStuff() {     if (Key.isDown(Key.LEFT)) {         dr = 1;     }     if (Key.isDown(Key.RIGHT)) {         dr = 2;     }     if (Key.isDown(Key.UP)) {         dr = 3;     }     if (Key.isDown(Key.DOWN)) {         dr = 4;     }     if (dr=1) {         this._x -= 5;     }     if (dr=2) {         this._x += 5;     }     if (dr=3) {         this._y += 5;     }     if (dr=4) {         this._y -= 5;     } } ball.onEnterFrame = moveStuff;

This is part of my game i am programming. I have done this game in True Basic and it works out totally fine but I am totally sucky at Flash Actionscripting cause i don't know a thing about how it works, loops, continuous checking of variables and moving stuff continuously.

By the way, i'm not trying to make a dot move when you press the directional keys, i'm trying to make it move continuously in a direction, like in the game "Snake".
hobbes_and_me is offline   Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 02:30 PM.

Follow actionscriptorg on Twitter


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.