How to make a first-person style game with arrow key movement?
Hey guys, I've made some simple click-to-move 1st person games with AS3, but I just wanted to know if there was a way to move around in 1st person with arrow keys, I was thinking you could get the background to move with the arrow keys, but that would be a little confusing.
If you guys have any suggestions for me, or if it's possible, please reply! Thanks
Here is a basic switch usage to move something with the keyboard:
stage.addEventListener(KeyboardEvent.KEY_DOWN, move_mc);
function move_mc(event:KeyboardEvent):void {
switch(event.keyCode)
case Keyboard.LEFT : mc.x -= 5
break;
case Keyboard.RIGHT : mc.x += 5
break;
case Keyboard.UP : mc.y -= 5
break;
case Keyboard.DOWN : mc.y += 5
break;
Similar Messages
-
How to make a 3rd Person Style Camera
Hello,
I am a Java3d Noob and need help with making ViewingPlatform Move. I do not want to use the in-built Keyboard Navigation found in java as I do not like the acceleration, deceleration and speed. The ViewingPlatform should be in third person - that is it is slightly behind the character.
Any simple code or guidance would be greatly appreciated
Thanks in Advance
Mahen.netHere is a basic switch usage to move something with the keyboard:
stage.addEventListener(KeyboardEvent.KEY_DOWN, move_mc);
function move_mc(event:KeyboardEvent):void {
switch(event.keyCode)
case Keyboard.LEFT : mc.x -= 5
break;
case Keyboard.RIGHT : mc.x += 5
break;
case Keyboard.UP : mc.y -= 5
break;
case Keyboard.DOWN : mc.y += 5
break; -
Screen Scrolls in games with arrow keys
My kids play a lot of games online. I can't lock the screen or whatever you want to call it. If the game requires the arrow keys to move the character, it scrolls the screen until they can't see the game. I have tried to click on the flash player game window but it still scrolls to the bottom of the page when you pich the arrow keys. Any help? Thanks!
What is "it"? Did you create the game in Flash, or is this an online game?
-
Develop AI for a bot in first-person shooting game
Hi, i'm working on a web-based first-person shooting game incorporating VRML and java. As for the AI part of the bot, somebody suggested me using JESS(Java Expert System Shell). I've looked through some tutorial about the API and usage of the software, but that's of little help when it comes to building a complex program contolling the AI of the bot. How do i start? any good reference or sample available on the net? thx for your help!
Do you mean artificial behaviour (i.e. having the bad guys act like bad guys), rather than actual artificial intelligence?
There's at least one good article on Artificial Behaviour on Gamasutra.com - it discusses the AI in Thief and Half-Life:
http://www.gamasutra.com/gdc2003/features/20030307/leonard_01.htm
(You will need to make a free account with Gamasutra to view this).
In particular, it covers some pseudocode for the basics of the artificial behaviour.
I hope this is of some use to you, it's at least interesting to read. -
How to make "Levels" in simple java game
I just wanted to know if anybody knew how to make "Levels" in a java game. In my case, it is to change two polygons that are used in the background. I think you have to use an array of some kind, but i dont really know.
Here is my source, the polygons are by the massive ///////// areas.
I cut out the majority of the program, because it was too long.
public class collision extends Applet implements MouseListener,MouseMotionListener
private Image rickImage,mazeImage;
Image Buffer;
Graphics gBuffer;
int x, y;
int[] LeftWallX = {0,204,204,149,149,162,162,243,260,235,259,232,260,230,207,207,0};
int[] LeftWallY = {500,499,402,402,341,324,227,191,157,141,135,123,116,109,86,1,1};
//int[] PlayAreaX = {204,204,149,149,162,162,243,260,235,259,232,260,230,207,207,263,263,245,282,262,274,257,273,250,184,184,170,170,208,216,216};
// int[] PlayAreaY = {499,402,402,341,324,227,191,157,141,135,123,116,109,86,1,1,86,103,115,129,138,147,155,201,230,323,340,384,384,402,499};
int[] RightWallX = {500,500,263,263,245,282,262,274,257,273,250,184,184,170,170,208,216,216};
int[] RightWallY = {500,0,1,86,103,115,129,138,147,155,201,230,323,340,384,384,402,499};
boolean mouseInside, collide;
boolean rolled = false;
boolean msg = true;
int sX=204,sY=490,sW=12,sH=9;
//Declare the rectangles
Rectangle movingRect,finshBloc,startBloc,oopsBloc;
//Declare the polygons
Polygon leftWall,playerArea,rightWall;
///Initiate
public void init()
rickImage = getImage(getDocumentBase(), "rick.jpg");
mazeImage = getImage(getDocumentBase(), "maze1.jpg");
collide=false;
Buffer=createImage(getSize().width,getSize().height);
gBuffer=Buffer.getGraphics();
rightWall=new Polygon(RightWallX,RightWallY,18);
playerArea= new Polygon(PlayAreaX,PlayAreaY,31);
leftWall= new Polygon(LeftWallX,LeftWallY,17);
public void paint(Graphics g)
drawStuff();
g.drawImage (Buffer,0,0, this);
*/I'm not exactly sure in your case what you are trying to accomplish. If all you want to do is make new polygons for your levels then you will simply need a Vector of type level (or polygon). Store multiple levels/polygons in that vector. This can be done many ways, probably the most efficient way would be to create a class Level of sorts and create each level object from there. This way you have all your levels stored into that vector.
I have made programs where the levels/mazes are randomly generated based on certain parameters (this way you would not need to define any specific level). This can be done inside the Level class and added to the vector so that when a level is randomly generated there are literally infinite possibilities. I would suggest posting all your code or at least a breakdown UML diagram of what is going on in your entire program. -
hello developers
I’m sharing a long time to find out how to make a wall for my game but now where is it.
Can someone help me?
its a wall for an iphone/ipod game.
It must be a wall that a sprite will stop walking it’s not a killer object but a stop object.
oh and are there differants in programing in ipad/iphone?
Thanks for help
Grtz JimmyI don't know what's you point on the wall and the player but you should do something as that:
-(IBAction)goLeft
if (player.x > wall.xo && player.x < wall.xI)
// you are in the wall go right
if(player.y > wall.yo && player.y < wall.yI)
// you are in the wall go right
player.x ++;
else ; // you are up or down of wall
-(IBAction)goRight
if (player.x > wall.xo && player.x < wall.xI)
if(player.y > wall.yo && player.y < wall.yI)
// you are in the wall go left
player.x --;
else ; // you are up or down of wall -
How to make your iPad and iPhone commicate with each other
How to make your iPad and iPhone commicate with each other
this is very easy...
firstly disconnect the DSL modem for the linksys..
then connect the computer to the linksys router (port 1/2/3/4)..
then access the linksys setup UI
open ur web browser
site: http://192.198.1.1/
username: [blank]
password: admin
now hook up the westell modem.. and goto the status page ...
check Internet IP.
if then Internet IP is 192.168.1.* then,
disconnect the westell from the router and goto the setup page.
change the LOCAL IP address to 192.168.2.1 (notice the 2.1 and not 1.1)
save settings....
connect the westell and viola ur online...
if the Internet IP is 0.0.0.0 then
goto the setup page and change the 'Internet connection Type' to 'PPPoE'
once done the page changes and give u a place to enter a username and a password.. this username and password is given by verizon..
sud be something like '[email protected]'
once done save settings...
goto the status page and hit connect... give it a few moments... u shud get a Internet ip address... if u get one ur online if not then power cycle the entire network. and try check to see if u get an ip..
hope this helps...
cheers..
Life is short... So get movin !!!
DopeLorD -
Has anyone figured out how to make the Yamaha 01V96i mixer work with Logic 9.1.8
Has anyone figured out how to make the Yamaha 01V96i mixer work with Logic 9.1.8 as a control surface ?
In YAMAHA01v96i:
Go to DIO/SETUP select Generic DAW. Go to MIDI settings page and set the desired port (personally I use Number 1), Select the same audio frequency you use in your DAW (I use 44.1KhZ)...at this point You should save a scene in you 01V96i to avoid to repeat all the procedure again.
Open studio manager, go to patch and set the input port from 17 to 32 respectively to USB1-USB16 (this will give you the return from you DAW to the 01v96i
Save again the scene overwriting the old one.
in LOGIC
Click on preferences, select Audio then select 01v96i, then click on control surface and select Mackie design Baby HUI and in the midi session set the same port that you've been setting on the Yamaha 01V96i (Port 1 if you follow this example).
That's more or less it.
It worked for me...so far -
Can I make a 4 person conference call with an iphone 4S
How to make a 4 person conference call on an iphone 4S
Apparently so:
How to make a 4 person conference call on an iphone 4S -
How to change the presets in pop-up menus (CS6 or CR 7, example Photo Filter) with arrow keys an see at the same time the changes on the photo?
It worked under Windows, now I use OS 10.8 and have to apply a preset with a click or Return button but after that the pop-up menu close so I have to open it once again to change a preset. Please help. Thank you!The filter panel is a shortcut for the content panel and it only effects the content of that window. So if you have a folder it will only see this as a folder and not with its content. (a Stack behaves about the same, being different in only counting the first file in the filter panel criteria but not what is in the stack itself)
You have a view work arounds, first is use menu view / show items from subfolders (this can take some time especially if you have not used caching before on this content) and this builds visible thumbs for all content and that can be used for filtering.
Or use the find command (Edit / find) and inhere specify the source and fill in the criteria include subfolders and this will give you the correct result.
When you create a smart collection the find command also pops up given you the same opportunity to get the results in a collection, but since a collection is only a bunch of aliases referring to the originals you might be a bit careful with editing and deleting. -
Good Morning. How do I delete directly from the iPhone, with out synching, movies and/or tvshows?
I had the same problem with Iphone 5 iOS 8, none of the methods described above were successful.
Finally, Iexplorer helped to solve my problem.
http://iexplorer-support.macroplant.com/customer/portal/articles/1325738-how-to- delete-all-photos-from-an-iphone-or-ipad
best regards,
salad -
How to insert data into two tables linke with foreign key..
I have two tables
1)EMP(emp_ID,username,emp_type_code)
emp_ID is primary key, emp_type_code is a foreign key references emptype table.
2)emptype(emp_type_code,emp_type_descripton)
emp_type_code is primary key
Could anyone help me ..how to insert data into EMP table. How to insert data into two tables linke with foreign key..CREATE TABLE "CATDB"."DWDIMUSER"
"USER_ID" NUMBER(10,0) NOT NULL ENABLE,
"SPECIALTY_ID" NUMBER(10,0),
"FULLNAME" VARCHAR2(20 BYTE),
"FNAME" VARCHAR2(20 BYTE),
"LNAME" VARCHAR2(20 BYTE),
"USER_SUBTYPE" VARCHAR2(20 BYTE),
CONSTRAINT "DIMUSER_PK" PRIMARY KEY ("USER_ID") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CATDB" ENABLE,
CONSTRAINT "DIMUSER_DIMSPECIALTY_FK" FOREIGN KEY ("SPECIALTY_ID") REFERENCES "CATDB"."DWDIMSPECIALTY" ("SPECIALTY_ID") DISABLE
CREATE TABLE "CATDB"."DIMSPECIALTY"
"SPECIALTY_ID" NUMBER(10,0) NOT NULL ENABLE,
"SPECIALTY_NAME" VARCHAR2(100 BYTE),
CONSTRAINT "DIMSPECIALTY_PK" PRIMARY KEY ("SPECIALTY_ID") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CATDB" ENABLE
INSERT INTO DIMUSER (FullName, FNAME, LNAME, USER_TYPE, USER_SUBTYPE)
SELECT DISTINCT
Engineer AS FullName,
regexp_substr(Engineer , '[^,| ]+', 1, 1) as FName,
regexp_substr(Engineer , '[^,| ]+', 1, 2) as LName ,
'Engineer'
FROM EMPLOYEELOOKUP;
INSERT INTO DIMSPECIALTY (SPECIALTY_NAME)
SELECT DISTINCT SPECIALITY
FROM EMPLOYEELOOKUP;
COMMIT;
CREATE TABLE employeelookup ...IS A TABLE THAT HAS ALL THE DATA NEDED TO BE FILLED IN BOTHE TABLES...
CREATE TABLE "CATDB"."EMPLOYEELOOKUP"
"EMPLOYEELOOKUP_ID" NUMBER(10,0) NOT NULL ENABLE,
"ENGINEER" VARCHAR2(25 BYTE),
"SPECIALTY" VARCHAR2(20 BYTE),
CONSTRAINT "DIMSPECIALTY_PK" PRIMARY KEY ("EMPLOYEELOOKUP_ID") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CATDB" ENABLE
DATA IN EMPLOYEELOOKUP
Engineer, Specialty,
John, Dow, Electronis,
Dow, Jons, Technician
Stan Smithers Sales
Mark, Richards Marketing
Jenny, Lane Marketing
John, Lee Sales
I NEED TO LOAD THE FOREIGN KEY IN DIMUSER FROM THE DIMSPECIALTY TABLE?
BY USING THE LOOKUP TABLE TO MARCH THE NAMES UNDER THE Engineer COLUMN, SPECIALTY COLUMNE DISTICTIVLY BY JOINING THE DIMSPECILTY TO RISTIVE THE PRIMARY KEY AND FILL IT IN THE DIMUSER TABLE AS A FOREIGNE KEY. -
Our WPF application uses DataGrid.
One of request is that first column of DataGrid does not show row separator and also does not show Left column separator. So it looks like the first column does not belong to the DataGrid. However, when select a row, the cell of first column still get selected.
How do we make it? Thx!
JaneCHi Magnus,
Thanks for replying our question and provide your solution!
Your solution works by setting "HorizontalGridLinesBrush" and "VerticalGridLinesBrush" to {x:Null} in the DataGrid style and modify "CellStyle" in first column as following:
<DataGridTextColumn MinWidth="32"
Binding="{Binding CellName}"
CanUserReorder="False"
CanUserSort="False"
Header="Cell}"
IsReadOnly="true" >
<DataGridTextColumn.CellStyle>
<Style TargetType="DataGridCell">
<Setter Property="IsEnabled" Value="False"></Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type DataGridCell}">
<Border BorderThickness="0" BorderBrush="{x:Null}"
Background="{Binding Background, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}" Margin="-1">
<Grid Background="{TemplateBinding Background}" VerticalAlignment="Center" Height="42">
<ContentPresenter VerticalAlignment="Center"/>
</Grid>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</DataGridTextColumn.CellStyle>
</DataGridTextColumn>
We found another way to achieve it by using DataGridRowHeader. The good way to use DataGridRowHeader is that we do not need to make the first column ReadOnly (click on first column does not select whole row anymore). Select RowHeader in a row will select
whole row. Move scroll bar horizontally, the row header still keep in visible area.
<Style TargetType="{x:Type DataGridRowHeader}" x:Key="dataGridRowHeaderStyle">
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="Height" Value="42" />
<Setter Property="SeparatorBrush" Value="{x:Null}" />
<Setter Property="FontSize" Value="16" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type DataGridRowHeader}">
<Grid>
<Border x:Name="rowHeaderBorder"
BorderThickness="0"
Padding="3,0,3,0"
Background="{Binding Background, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"
BorderBrush="{x:Null}">
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Border>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<DataGrid>
<DataGrid.RowHeaderStyle>
<Style TargetType="DataGridRowHeader" BasedOn="{StaticResource dataGridRowHeaderStyle}">
<Setter Property="Content" Value="{Binding CellName}" />
<Setter Property="Width" Value="35"/>
</Style>
</DataGrid.RowHeaderStyle>
</<DataGrid>
JaneC -
How to make duplicate the para styles
Hi,
I have already created some set of styles for journal tempalte [E.g.: jNL,jUNL,...].
Now I want to create same set of styles but starting with 'b' for book. [E.g.: bNL,bUNL,...].
How to get duplicate 200 style names, but 'j' has to change 'b'.
FYI:
Is this possible by script?
by
hasviI would strongly recommend to make organized styles, all depending on each other like a tree.
So let's say make a basic para style, then create a folder (group) for the first style, depending on the basic. Name the folder J or Journal and the styles List1, List2, etc.
When this group is complete, duplicate the folder (group) and rename it book. The styles have the same name, but are different in the group. This is easier to handle than to to rename each style.
I do a similiar thing. I create a complete style sytem with groups and subgroups based on an outside basic style, but in the group is another basic style, this has the language German, when this group is complete, I duplicate it, change the name and change the basic style in the group to English, so I have the very same style name with a different language. In this basic style I adjust also language dependend GREPs, tracking or spaces should be wider in English because it needs less space normally, etc.
It is easier to work with groups than with renaming the styles, and you get a very similiar result for using it. -
How to make my first website in Coldfusion Builder
Hi everyone,
Here is my problem that I really need help with.
Context:
I just moved from Dreamveawer to Coldfusion Builder. I want to:
-> Set up my first server
-> Creating an SQL DB on the server
-> Create an index page and display query results
When I started CF builder, i watched the videos on 'Getting Started ' screen. But my things didn't go as smooth as that of the guy in the video. After setting up the server I sometimes cannot start the server and sometimes the server starts but I can't access the CF Admin page (I couldn't access the admin page even once).
Question(s):
Does CF Builder installer also include Coldfusion setup or I have to install Coldfusion prior to installing the CF Builder?
Is there any way of getting details about all the fields that I fill in during installation of Coldfusion/CF Builder, so I know what I am filling instead of just blindly following that dumb guy in the video
Other Info:
I am using Win7 64bit
Installed Coldfusion9
Installed CF Builder2 (standalone)
P.S.
I already watched these videos but they didn't work for me:
-> http://tv.adobe.com/watch/adc-presents/getting-started-with-coldfusion-builder-2/
-> The video on CF Builder2 start screenThanks for clarifying. Terry is a good guy. Glad you didn't mean him
It is likely that when you installed ColdFusion you selected the "Server Configuration" (because you would know it if you did not). The other two options are quite complicated. You can verify this just by answering this question. Do you access ColdFusion via port 8500. If so, then you are using the Server Configuration.
This means that your webroot is probably located at c:\ColdFusion9\wwwroot
If you installed ColdFusion to a different location (like D:\) then you should be able to just make that change above.
Change your workspace in CFBuilder (FILE >> Switch Workspace) to point to that wwwroot directory, then recreate your project and try it again.
There are other ways of handling most of this. But this is probably the easiest.
And trust me, when it comes to teaching, it's hard to please everyone. ColdFusion Builders target audience is likely experienced CF developers. Of course n00bs can use it too, but I am sure when they created those videos there interest was in getting existng CF developers on board. I teach a server-side programming course at the college level and it can be very hard teaching the IDE and the Server software at the same time. And I can see people struggling with figuring out the differences in terminology and technology.
Where does the IDE stop and the server begin?
I got an error, is the problem in CF or CFB?
CFB says I have an error, but my code still runs, I don't understand.
It's a tough line to cross. I am sure Adobe would be interested in hearing your feedback on how to make the training videos better, or on what types of new videos should be created. But try not to be too hard on them for not havign exactly what you need.
Jason
Maybe you are looking for
-
Fact Sheet - implementing BI Reports
Hi Experts, how can i implement my own BI Reports into the Fact Sheet in CRM 2007. I know the customizing point "maintain Fact Sheet" but the problem is that if I choose BP_FACTSHEET and take a look into the view assignments I only find the entry BP_
-
How do I get music to stream to Apple TV from my macbook air with Mavericks
Just bought a Macbook Air last week. I am very conversant with Apple TV and Macs. I have two iMacs and stream music from them to Apple TV and it's fine. They are running Lion and Snow Leopard. My Air is running Mavericks. I open iTunes, enable Home
-
Referencing a movieclip instance from an (loaded) external swf.
Hi everybody I'm new to AS3. Even experienced in AS2, i'm a bit confused in getting the following result. Let's assume the following. The mainmovie has a movieclip instance called 'window1'. I need to have loaded a movieclip (submov.swf) in the mainm
-
Using the Java API to address a specific instance
Hi, I've created another operation (onRequest) in the client of an async. process. <!-- portType implemented by the Exp2 BPEL process --> <portType name="Exp2"> <operation name="initiate"> <input message="tns:Exp2RequestMessage"/> </operation> <opera
-
Hello, I am the sole IT person at a Highschool of about 500+ kids. We just bought a new mac mini server with a pegasus 12tb add on. We always used mac but the students data has been stores locally on computers. We would like to keep their accounts