How to collide with tile in scolling game?
Hi all!
I have the following problem - I want my airplane to be able to collide with a tile.
this are the methods I'm now using but they doesn't seem to work as I want them to...
In the GameCanvas class:
/*method to check for collission*/
boolean containsImpassableArea(int x, int y, int widths, int heights) {
int rowMin = y / tHeight;
int rowMax = (y + heights - 1) / tHeight;
int columnMin = x / tWidth;
int columnMax = (x + widths - 1) / tWidth;
for (int row = rowMin; row <= rowMax; ++row) {
for (int column = columnMin; column <= columnMax; ++column) {
int cell = tBakgrund.getCell(column, row);
if (cell == STOP_TILE) {
return true;
return false;
/*method to check for keystates and invokes containsImpassableArea */
private void checkKeys() throws Exception {
int keyStates = getKeyStates();
if ((keyStates & LEFT_PRESSED) != 0) {
if (sprit.getX() > 0
&& !containsImpassableArea(sprit.getX() - 4, sprit.getY(),
sprit.getWidth(), sprit.getHeight())) {
sprit.move(-4, 0);
sprit.setFrame(8);
} else {
sprit.setFrame(9);
/*the same on RIGHT_PRESSED, UP and DOWN*/
/* if no key is pressed */
if ((keyStates == 0)) {
sprit.setFrame(9);
if(containsImpassableArea(sprit.getX(), sprit.getY() - 4,
sprit.getWidth(), sprit.getHeight())) { scrolling = false; }
else{
scrolling = true;
/* the method that handles the scolling */
if (terrainScroll < 0 && scrolling == true ) {
terrainScroll += 2;
tBackground.setPosition(0,terrainScroll);
}//end of method checkkeys...
ok.... why doesn't it work ...is it some kind of layerproblem (sprite and tiles not in the same layers)?
Perhaps someone has any code samples?
Thanks in advance!
/arnold
please use the [ code ] formatting tags when posting code.
I'm not sure exactly, but it looks like you are only testing the end location of the player. For accurate collision detection, you need to test for collisions between all points between the start and end location. For example, if you are flying at a wall at full speed, the next calculated frame may be behind the wall, not on it. The way you implemented itI guess this is only a worry if your max speed is faster then the width or height of the sprite, but it may be something to consider once you allow variable speeds.
Similar Messages
-
How to add SharePoint 2013 Promoted link list view web part in page programatically with Tiles view using CSOM. I found that it can be
done by using XsltListViewWebPart class but how can I use this one by using shraepoint client api.
shivNice, can you point me to the solution please ?
I'm trying to do this but I get an error :
Web Part Error: Cannot complete this action. Please try again. Correlation ID: blablabla
StackTrace: at Microsoft.SharePoint.SPViewCollection.EnsureViewSchema(Boolean fullBlownSchema, Boolean bNeedInitallViews) at Microsoft.SharePoint.SPList.GetView(Guid viewGuid)
All help really appreciated. -
My computer didn't reconize my ipod, It tell me I have syncr with a another biblio, but I nerver put it in another computer. How I can't lose all the game on my ipod because itune want to erase my ipod and sync, What I can do tosave
My computer didn't reconize my ipod, It tell me I have syncr with a another biblio, but I nerver put it in another computer. How I can't lose all the game on my ipod because itune want to erase my ipod and sync, What I can do tosave
-
My tiles on Mahjong game have quadrupled in size. How can I get original size back?
My tiles in Mahjong game have quadrupled in size. How can I get original size back. thanking you in advance. Earl66.
Earl, welcome to the forum.
It sounds like the resolution changes when you start the game. You should check the video settings. I checked the Mahjong game (Win 8.1) on my computer and there is no way to set the resolution in the Options.
Please click the "Thumbs up + button" if I have helped you and click "Accept as Solution" if your problem is solved.
Signature:
HP TouchPad - 1.2 GHz; 1 GB memory; 32 GB storage; WebOS/CyanogenMod 11(Kit Kat)
HP 10 Plus; Android-Kit Kat; 1.0 GHz Allwinner A31 ARM Cortex A7 Quad Core Processor ; 2GB RAM Memory Long: 2 GB DDR3L SDRAM (1600MHz); 16GB disable eMMC 16GB v4.51
HP Omen; i7-4710QH; 8 GB memory; 256 GB San Disk SSD; Win 8.1
HP Photosmart 7520 AIO
++++++++++++++++++
**Click the Thumbs Up+ to say 'Thanks' and the 'Accept as Solution' if I have solved your problem.**
Intelligence is God given; Wisdom is the sum of our mistakes!
I am not an HP employee. -
How to we use Tiles Framework with ADF Faces ?
Hello Every body,
Can anyone tell me whether We mix Tiles framework of Struts, and ADF Faces Framework?
I 've found that we can mix JSF and Tiles, but can we use ADF Faces and Tiles together?
Waiting for your answer!
Thanking you ,
Samba.Dear Experts,
Please help me !
As I could not get enough help from you masters,
I set out to do on my own, hoping that at some time you would come to my rescue.
I designed a simple jspx page SiteLayout.jspx whose code is given below:
<?xml version='1.0' encoding='UTF-8'?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:af="http://xmlns.oracle.com/adf/faces"
xmlns:afh="http://xmlns.oracle.com/adf/faces/html"
xmlns:c="http://java.sun.com/jstl/core"
xmlns:tiles="http://jakarta.apache.org/struts/tags-tiles">
<jsp:output omit-xml-declaration="true" doctype-root-element="HTML"
doctype-system="http://www.w3.org/TR/html4/loose.dtd"
doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"/>
<jsp:directive.page contentType="text/html;charset=UTF-8"/>
<f:view>
<af:document>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>SiteLayout</title>
</head>
<body>
<h:form binding="#{backing_SiteLayout.form1}" id="form1">
<af:table id="PageLayout" width="100%" >
<!-- <tiles:getAsString name="title" /> -->
<f:subview id="siteview">
<tiles:insert definition="siteLayoutDef">
<af:table id="headertable" width="100%">
<tr>
<td width="100%" colspan="2">
<f:subview id="header">
<tiles:insert attribute="header"/>
</f:subview>
</td>
</tr>
<tr>
<td width="100%" colspan="2">
<f:subview id="topview">
<tiles:insert attribute="topmenu"/>
</f:subview>
</td>
</tr>
<tr>
<td width="100%" colspan="2">
<f:subview id="navigationview">
<tiles:insert attribute="navigationbar"/>
</f:subview>
</td>
</tr>
<tr>
<td width="30%">
<f:subview id="leftview">
<tiles:insert attribute="leftmenu"/>
</f:subview>
</td>
<td width="70%">
<f:subview id="contentview">
</f:subview>
<tiles:insert attribute="content"/>
</td>
</tr>
<tr>
<td width="100%" colspan="2">
<f:subview id="footerview">
<tiles:insert attribute="footer"/>
</f:subview>
</td>
</tr>
</af:table>
</tiles:insert>
</f:subview>
</af:table>
</h:form></body>
</html>
</af:document>
</f:view>
<!--oracle-jdev-comment:auto-binding-backing-bean-name:backing_SiteLayout-->
</jsp:root>
My SiteLayout.jspx defines the layout of the pages on my Web application.
My Home page is this:
<?xml version='1.0' encoding='UTF-8'?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:afc="http://xmlns.oracle.com/adf/faces/webcache"
xmlns:af="http://xmlns.oracle.com/adf/faces"
xmlns:afh="http://xmlns.oracle.com/adf/faces/html"
xmlns:afi="http://xmlns.oracle.com/adf/industrial/faces"
xmlns:graph="/webapp/graph.tld"
xmlns:c="http://java.sun.com/jstl/core"
xmlns:tiles="http://jakarta.apache.org/struts/tags-tiles">
<jsp:output omit-xml-declaration="true" doctype-root-element="HTML"
doctype-system="http://www.w3.org/TR/html4/loose.dtd"
doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"/>
<jsp:directive.page contentType="text/html;charset=UTF-8"/>
<f:view>
<af:document>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>Home</title>
</head>
<body>
<!-- <tiles:getAsString name="title" ignore="true" /> -->
<h:form binding="#{backing_Home.form1}" id="form1">
<tiles:insert definition="siteLayoutDef" flush="false">
<tiles:put name="header" value="/Header.jspx" />
<tiles:put name="footer" value="/Footer.jspx" />
<tiles:put name="leftmenu" value="/LeftMenu.jspx" />
<tiles:put name="content" value="/Content.jspx" />
<tiles:put name="header" value="/TopMenu.jspx" />
<tiles:put name="footer" value="/NavigationBar.jspx" />
</tiles:insert>
</h:form>
</body>
</html>
</af:document>
</f:view>
<!--oracle-jdev-comment:auto-binding-backing-bean-name:backing_Home-->
</jsp:root>
My <tiles-defs> page is this:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE tiles-definitions PUBLIC "-//Apache Software Foundation//DTD Tiles Configuration 1.1//EN" "http://jakarta.apache.org/struts/dtds/tiles-config_1_1.dtd">
<tiles-definitions>
<definition name="tiles-defs"/>
<definition name="siteLayoutDef" path="/SiteLayout.jspx">
<!--<put name="title" value="SiteBean.getQuoteofDay()" /> -->
<put name="header" value="/header.jspx" />
<put name="footer" value="/footer.jspx" />
<put name="content" value=""/>
<put name="topmenu" value="/TopMenu.jspx"/>
<put name= "leftmenu" value="/LeftMenu.jspx"/>
<put name="navigationbar" value="/NavigationBar.jspx"/>
</definition>
</tiles-definitions>
My Web.xml is this:
<?xml version = '1.0' encoding = 'UTF-8'?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee">
<description>Empty web.xml file for Web Application</description>
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>server</param-value>
</context-param>
<!-- Tiles ViewHandler config file -->
<context-param>
<description>Tiles configuration
definition files and a listener need to be defined.
the listener will initialize JspTilesViewHandlerImpl with tiles definitions.
</description>
<param-name>tiles-definitions</param-name>
<param-value>/WEB-INF/tiles-defs.xml</param-value>
</context-param>
<context-param>
<param-name>javax.faces.CONFIG_FILES</param-name>
<param-value>/WEB-INF/faces-config.xml, /WEB-INF/tiles-defs.xml</param-value>
</context-param>
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.jspx</param-value>
</context-param>
<context-param>
<param-name>oracle.adf.view.faces.ALTERNATE_VIEW_HANDLER</param-name>
<param-value>
org.apache.myfaces.tomahawk.application.jsp.JspTilesViewHandlerImpl
</param-value>
</context-param>
<filter>
<filter-name>adfFaces</filter-name>
<filter-class>oracle.adf.view.faces.webapp.AdfFacesFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>adfFaces</filter-name>
<servlet-name>Faces Servlet</servlet-name>
</filter-mapping>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>resources</servlet-name>
<servlet-class>oracle.adf.view.faces.webapp.ResourceServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>resources</servlet-name>
<url-pattern>/adf/*</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>35</session-timeout>
</session-config>
<servlet>
<servlet-name>Tiles Servlet</servlet-name>
<servlet-class>
org.apache.struts.tiles.TilesServlet
</servlet-class>
<init-param>
<param-name>definitions-config</param-name>
<param-value>/WEB-INF/tiles-defs.xml</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>
<mime-mapping>
<extension>html</extension>
<mime-type>text/html</mime-type>
</mime-mapping>
<mime-mapping>
<extension>txt</extension>
<mime-type>text/plain</mime-type>
</mime-mapping>
</web-app>
The Error I'm getting is :
IllegalStateException :No ADFRenderingContext;
What happened?
Where did I go wrong?
could you please help me?
Thanking you in advance,
Waiting for your response,
Samba.
Message was edited by:
saasira
Message was edited by:
saasira
Message was edited by:
saasira -
How to make a really basic pong game for a beginner
Hello. I've read through a couple of threads on here dealing with making a game of pong in LabView, but in them the users had questions with far more complex aspects of the program than I want to deal with. I am a beginner programmer in LabView with limited experience in Java and Visual Basic programming. I was tasked with creating a game over winter break, and now that I finally have some time (this weekend that is), I decided that I'd make a really simple game of pong. However, I have seriously overestimated the difficulty of this for a beginner who has very limited knowledge of Lab View.
I ask you to please have some patience with me.
I know what I want to do, and just need help inplementing it.
Here is the idea for my design to keep it as simple as possible:
-Create a field (I am not sure what to use for this, but from my reading it appears that some sort of a picture output is needed, but I cannot find that anywhere).
-Set up some simple function that can output the dimensions of this field to use with collision tracking.
-Create a ball that can be tracked by the program.
-From my reading I understand that the simplest way to "bounce" the ball off the sides appears to simply reverse the X velocity of the ball when it strikes the vertical boundaries and the Y velocity when it strikes the horizontal boundaries.
-Insert some sort of a "paddle" that the user can control with the left and right arrow keys.
Now, as I have mentioned I am a beginner with approximately one month maximum knowledge of this software, spread over about a year. I want to take things slow. So for starters, would anyone be willing to walk me through creating a visual output for this and creating a ball that will bounce off all sides?
If I can at least get that far for now, then I can move on (with help I hope!) of inserting an interactive interface for the "paddle."
I have found some LabView code for a simple game like this, but it also includes a score keeping loop as well as an "automatic play" option, and I am attempting to wade through all that code to find the bones of it to help me with this, but due to my inexperience, this might thake a lot of time.
I thank you for any and all help anyone may be able to provide.EchoWolf wrote:
-Create a field (I am not sure what to use for this, but from my reading it appears that some sort of a picture output is needed, but I cannot find that anywhere).
Wel, there is the picture indicator in the picture palette. In newer versions it's called "2D picture". The palettes have a search function. Using the palette search function is a basic LabVIEW skill that you should know. If you've seen the example for the other discussion, it uses a 2D boolean array indicator. The boolean array is only recommended for a monochrome very low resolution display.
EchoWolf wrote: -Set up some simple function that can output the dimensions of this field to use with collision tracking.
-Create a ball that can be tracked by the program.
That seems backwards. Properly programmed, the code always knows the dimension and the ball position. The program generates, (not tracks!) the ball movement. Of course you need to do some range checking on the ball position to see when it collides with the walls.
EchoWolf wrote:
-From my reading I understand that the simplest way to "bounce" the ball off the sides appears to simply reverse the X velocity of the ball when it strikes the vertical boundaries and the Y velocity when it strikes the horizontal boundaries.
Of course you could make it more realistic by keeping track of three ball parameters: x, y, spin.
EchoWolf wrote:
-Insert some sort of a "paddle" that the user can control with the left and right arrow keys.
Pong is typically played with the up-down arrow keys.
EchoWolf wrote:
Now, as I have mentioned I am a beginner with approximately one month maximum knowledge of this software, spread over about a year.
LabVIEW knowledge is not measured in time units. What did you do during that month? Did you attend some lectures, study tutorials, wrote some programs?
EchoWolf wrote:
So for starters, would anyone be willing to walk me through creating a visual output for this and creating a ball that will bounce off all sides?
I have found some LabView code for a simple game like this, but it also includes a score keeping loop as well as an "automatic play" option, and I am attempting to wade through all that code to find the bones of it to help me with this, but due to my inexperience, this might thake a lot of time.
Start with the posted example and delete all the controls and indicators that you don't want, then surgically remove all code with broken wires.
Alternatively, start from scratch: Create your playing field. Easiest would be a 2D classic boolean array that is all false. Use initialize array to make it once. Now use a loop to show the ball as a function of time.
Start with a random ball position. to display it, turn one of the array elements true before wiring to the array indicator using replace array subset.
Keep a shift register with xy positions and xy velocities and update the positions as a function of the velocities with each iteration of the loop. Do range checking and reverse the velocieis when a edge is encountered.
What LabVIEW version do you have?
LabVIEW Champion . Do more with less code and in less time . -
How Can I Learn To Develop Flash Games For Under $50.00 USD?
I am completely new to anything Flash. I have never written a
single line of Actionscript. I don't know the difference between
Flash and Flex. I don't know in what forums Flash developers hang
out. I don't even know what kind of coffee they drink, or if they
drink tea instead.
However, I have developed games and have been thinking about
developing some casual games and have heard rumors that Adobe is
"pushing" causal game development with Actionscript 3 and their
latest releases. So I went to adobe.com expecting to see a link for
something like "learn how to develop games in flash" or some such.
I poked around the developer related pages and didn't find anything
I thought useful.
What I did find were plenty of stuff for *existing* flash
developers. Links to articles and HowTos for specific topics and
information about products that cost a minimum of several hundred
dollars. I can't learn how to develop games and create a prototype
with a 30-day trial, and I am not going to buy a $1000 pro-grade
tool when I am an indie developer without a budget or a pre-funded
project that would justify such expenditures.
I have seen some open source stuff, but don't know if it can
do anything more than build some annoying shaking banner ads.
So let me introduce myself as a possible use-case for Adobe
Marketing and the Flash (Game) Developer community.
I am an educated experience software developer who has a day
job doing "enterprise" software stuff. I want to *play* in my free
time (evenings and weekends) with "Flash Stuff" and learn enough to
be able to build a simple game that I can put on my personal
website and have my friends download. I am not a student, so I
can't get student discounts. The money I have goes toward
toys^H^H^H^H tools for my other coding habits^H^H^H^H^H projects. I
am not interested in 30-day trials, as I may go 45-days or more
between the first and second weekends I get to play with this. I
know OOP so I want to start out learning how to do the "advanced"
stuff from day one and not have to start with dragging and dropping
PNGs w/o any coding and then "relearn" how to do it in code so I
can do anything beyond having the image appear and rotate.
I *am* willing to put time into this endeavor, but only after
I have a few things spoon-fed to me by "advocates" who's job is to
get me "hooked" and willing to invest my time to go beyond Hello
World. At the same time I am download and playing with GarageGames,
TGE/TGB, Game Maker, Dark Basic, Blitz Basic, etc. and many
complete development environments that are full-featured and
completely free if I limit myself to releasing only freeware games,
or cost me less than $50 for the "professional" version with all
the bells and whistles.
I have heard rumors and rumblings about some open source
tools being available and Adobe maybe open sourcing some of their
previously pay-to-play tools, but also understand that Adobe can
probably provide a better "comprehensive" package of tools,
documentation, tutorials, and support, *if I can find the right
place to ask/start.*
And, most of all, I don't know where to start my search as I
have no personal contacts to bug about stuff like this.
So, where can I find the big red button to push and get
everything I want handed to me on a silver-platter.
[please understand I have written this with some attempt at
self-mocking humor and am not some clueless n00b]
Thank you for taking the time to read my lengthy posting. I
hope to find some helpful replies and start down an interesting
learning path.
--ChaimJust saw your post. Better late than never. You may want to
consider GameBrix.com, where you can create Flash based, casual
games using your web browser. No downloads are required. You can
create a game from scratch using a library of images, sounds and
game mechanics. You can also upload your own. The online script
editor will allow you to view and edit the ActionScripts associated
with each game mechanic. In short, a great way to ramp up on game
design and build your own game without investing a lot of $
upfront.
BTW I am associated with GameBrix so any feedback is
appreciated. -
Import collides with another import statement
Suppose I have 2 packages, train and plane. Each package has a class called Engine. In addition, train.Engine and plane.Engine have nothing in common. In a 3rd class, I import both of these:
import train.Engine;
import plane.Engine;Doing so results in the following error:
The import plane.Engine collides with another import statement
How do I do this?One of these imports have to be commented. The imports are reside in the source code, not just in jar or other class path entries. If the imports are in different files then you'd browse the sources and find import with the same name but in different name spaces. This is happened if you you don't wanna add a big jar to the class path instead you created a class file with the same name because of huge references. And you just wanted route it out of the jar and possibly remove dependency.
-
How to deal with moving around like in gta2?
Hi there,
I'm programming an game but i was wondering how to deal with moving around like in gta2.
my game is also top-down with you(tha player) constantly in the middle of the screen. I know how to deal with button press etc.. but how to calculate how manny pixels the map has to move in the x and y axis...
It's difficult to explain for me.. but hope the picture is clear..
greetingsI was afraid for this one already.. the picture is not clear:) thanx for your response so far.. I will try again.. with the game gta2 in mind:)
see this screenie: http://www.vollversion.de/bilder/705_1_full.jpg
My game looks the same as gta2 top down... with the character in the middle of the screen(the one firing the flame thwower )(the player). if i press up he walks towards the police car.. if i press left or right.. he only turns around(an combination of pressing up and left is also posible) thus the character walks in the direction he's facing.
Now i would like to know how did they do this? how to programm such a movement? Because the character is standing constnatly in the middle of the screen the map has to move like in almost every game... how to calculate the x and y axis movement of the map?
Please.. try agian.. hopefully the screenie will help. -
Is in JSF (with Creator) a tehnologie similar with Tiles?
Hy! I'm new and I want to ask: is in JSF a tehnologie similar with Tiles? How can I make my jsf pages to have some header and footer? Of course, in Creator.
Thank you very much.In general, by design, JSF is a much more flexible framework as JSF is built with integration and extensibility in mind. JSF isn't easier than Struts when developing by hand, but using Sun Java Studio Creator can make it much much easier and greatly increase your productivity.
Take a look at the Craig McClanahan's Weblog (He was the original creator of the Struts Framework, and was the co-specification lead for JavaServer Faces (JSF) 1.0 )
http://blogs.sun.com/roller/page/craigmcc/20040927#struts_or_jsf_struts_and
A good place to learn more about JSF is JSF Central .
http://jsfcentral.com/
As for your second question, you could use 'Page Fragment Box'. Check the online help for "Page Fragment Box".
'This component enables you to include a page fragment in a page. A page fragment is a separate, reusable part of a page that can be included in any number of pages. For example, you might want to put a common a visual element like a header graphic in a page fragment and then include it in all the pages in an application......'
Hope that helps. -
Hi
I am using JSF with tiles and am having issues with page navigation with using tiles. Can any body tell me what to write in faces-config.xml so that the required page opens in tile which i have defined for that page in the corresponding tiles-defs.xml.
Here is the detail of code i am using
web.xml:
<context-param>
<param-name>tiles-definitions</param-name>
<param-value>/WEB-INF/tiles-defs.xml</param-value>
</context-param>
<context-param>
<param-name>javax.faces.CONFIG_FILES</param-name>
<param-value>
/WEB-INF/faces-config.xml
</param-value>
</context-param>
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>client</param-value>
</context-param>
<context-param>
<param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>org.apache.myfaces.PRETTY_HTML</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>org.apache.myfaces.DETECT_JAVASCRIPT</param-name>
<param-value>false</param-value>
</context-param>
<context-param>
<param-name>org.apache.myfaces.AUTO_SCROLL</param-name>
<param-value>true</param-value>
</context-param>
<listener>
<listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
</listener>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.faces</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
faces-config.xml
<faces-config>
<application>
<view-handler>
org.apache.myfaces.application.jsp.JspTilesViewHandlerImpl
</view-handler>
</application>
<from-view-id>*</from-view-id>
<navigation-rule>
<navigation-case>
<form-outcome>register</form-outcome>
<to-view-id>/tiles/register.page</to-view-id>
</navigation-case>
</navigation-rule>
</faces-config>
tiles-defs.xml
<tiles-definitions>
<definition name=".mainLayout" path="/tiles/main-layout.jsp">
<put name="title" value=""/>
<put name="header" value="/tiles/header.jsp"/>
<put name="search-menu" value="/tiles/search-menu.jsp"/>
<put name="body" value=""/>
<put name="footer" value="/tiles/footer.jsp"/>
</definition>
<definition name="register.page" extends=".mainLayout">
<put name="body" value="/tiles/register.jsp"/>
</definition>
</tiles-definitions>
from page where we call register rule
<h:commandLink action="register" value="Register"/>
it opens register.jsp as new page instead of opening it into tile.
Please helpmeout in knowing where I am wrong and let me know how to open next page in tile because welcome page is opening very well in tile but when I click for next page whose definition is defined in tiles-def.xml it doesnot open in tile
ThanksStill strugling with jsf1.2+tiles
-
How can I choose another name for Game Center? (not a nick)
How can I choose another name for Game Center ? (not a nick)
Hi XxCarrisxX,
I apologize, I'm a bit unclear on exactly what you are asking. If you are talking about changing to or using a different Apple ID in Game Center, you may find the following article helpful:
Sign in to your Game Center account using your Apple ID. If you don't have an Apple ID or another Apple account, tap or click Create New Account to create an account to use with Game Center.
You can change the account you are signed into by:
iOS: Tap Settings > Game Center.
OS X: Click the Me tab in the Game Center app and click on your Account.
Apple Support: Using Game Center
http://support.apple.com/kb/ht4314
However, make sure you are aware of the following:
Note: Please note each Apple ID has its own associated scores, achievements, and friends.
Apple IDs are also tied to your other Apple services, and therefore should not be created lightly.
Regards,
- Brenden -
How to deal with '$' sign in the class name?
I want to put my Java Applet game on my homepage. But the server which I set up my homepage doesn't support the file name like XXX$XXX.class, which has '$' sign in the file name. Would anyone can tell me how to deal with this problem? And how can I make the game work on my homepage? Thanks.
Don't forget, this include both concrete inner classes as well as any anonymous inner classes you create, like
myButton.addActionListener(new ActionListener()
// Yada Yada Yada -
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. -
The time sheet record collides with an attendance.
Dear Expert,
I got the following error message when I try to apply OT through CAT2.
Message no. HRTIM00CATS208
Diagnosis
The time sheet record from 18:00 - 19:00 o'clock collides with an attendance or absence of less than one day recorded in HR Time Management. The record entered in HR Time Management is entered in the next line.
My overtime is record in infotype 2002 and subtypes 1010 while the attendance is in infotype 2002 and subtype 1000. I just want the overtime to check against the absences (e.g. leave) but not the attendance. This attendance is just for display only.
Any idea how to configure?
Thanks
Regards,
BryanHi Aditya,
My constraint class for infotype 2002 subtype 1000 (attandance) is 1 and infotype 2002 subtype 1010 (overtime) is 2.
I already specify any class of infotype 2002 that crash with 2002 (any class) to N at V_554Y_B. But it is still giving me the same error message.
Any idea?
Thanks
Regards,
Bryan
My constraint class for infotype 2002 subtype 1000 (attandance) is 1 and infotype 2002 subtype 1010 (overtime) is 2.
I already specify infotype 2002 crash with 2002 (any class) to N at V_554Y_B. But it is still giving me the same error message.
Any idea?
Thanks
Regards,
Bryan
Maybe you are looking for
-
CUPS Error message when printing from some applications
Hi. I've got an issue when printing from some apps, but not others. Up to a few months ago everything was fine, then it started when Word would not print direct to my printer (Epson Stylus Pro 3880), not a big deal as I don't use it a lot and could p
-
24" iMac has buzzing sound every 5 min during sleep after upgrading to is x lion
I have a 24" iMac purchased new in 2009. Haven't had a problem and usually put it to sleep mode at night with no problem. I recently upgraded to OS X Lion and started noticing 2 problems during sleep mode. One is a constant humming noise that wasn
-
Hello, Just bought an ipod touch 32Gb 3rd Gen. I clicked on the Apps icon and went to Free Apps and thought of downloading a GPS app (it said Free). However when I went to install it it asked for my paswword twice and then sent me to my payment detai
-
Transfer an existing Website to Adobe Muse
Hello friends! I have a new question: It is possible, to transfer an existing website (with all the HTML and CSS documents with the help of the FTP server) to Adobe Muse? Or do I must create all the website again? Thanks!
-
Hey, is there a BAPI that returns the line items of a given account and a time frame?