xna-4.0


How to add an end screen in XNA 4.0?


Right, the game I've got is a 2D car racing game. I have implemented the finish line image in the game and so on. And I've got it as a separate sprite sheet. Here's the code I'm attempting to alter in such a way, that 'If car1blue intersects finishLine1, end game.' But I just can't seem to get it right. Here's the code I'm attempting to alter;
if (IntersectPixels(destinationBlueRect, finishLine1TextureData, finishLine1Rectangle, finishLine1TextureData))
{
blueHit = true;
}
It would be even better if you could show me how to add an end game message saying 'Player 1 wins' (when car crosses finishline1) and end game roughly three seconds after that?
Any help is welcome please (I'm a newbie). Thank you!
You may want to implement this Game State Management system, as for your delay:
float delayTime = 3000;// Time to delay in milliseconds
float delayBuffer = 0;// This will count how much time has passed
// In your Update method
if (blueHit) {// You should change this to whatever way you find if someone has won the game
if (delayBuffer < delayTime) {
delayBuffer += (float)gameTime.ElapsedGameTime.TotalMilliseconds;
} else {
// Show the last screen
}
}

Related Links

Can't reset my gametime to zero in XNA
Displaying seconds in XNA with Keypress?
XNA game how to make a snake tail
Creating an array of game objects
Lap timer in XNA 4.0?
XNA: Identifying identical sprites created with for loop
Increase Character Spacing in XNA
XNA choosing a subgroup of Game.Components
Loading Silverlight Texture2D from Resources
XNA Game - Open a Popup or a Custom Game Screen before launching a game
'Microsoft.Xna.Framework.Vector2' is a 'type' but is used like a variable?
Making a trading card game XNA
How do I fix 'No suitable method found to override' error on XNA 4.0?
When to use PresentationParameters.BackBufferWidth vs .Viewport.Width
What does the pixel shader function tex1D do with a Texture2d
How to add a lap timer in XNA?

Categories

HOME
java
log4j
google-chrome-extension
osgi
netsuite
fluentd
heroku
kde
lodash
dot
frameworks
disassembler
windows-server
opengl-es-2.0
wamp
django-imagekit
awesome-wm
python-unittest
kibana-4
windows-azure-storage
jplayer
task
vaadin7
pc
angular-ui
jndi
smb
spark-jobserver
fgetcsv
maxmind
spring-mybatis
elasticsearch-net
uisplitview
scorm2004
asset-pipeline
form-data
mpmediaquery
bower-install
wixsharp
plsql-psp
qwerty
objectlistview
galen
segment
wso2carbon
qsslsocket
rails-routing
dandelion
sage-one
togetherjs
elgg
worker-thread
lift-json
or-tools
instant
gridpane
dstu2-fhir
blackberry-10
skype4py
independentsoft
energy
spim
jmeter-maven-plugin
wireshark-dissector
android-listview
drawbitmap
clipperlib
apache-commons-net
directoryservices
oxwall
cctv
qcodo
zend-route
xojo
jubula
mysql-error-1062
mechanize-ruby
undefined-reference
fmod
access-rights
cdc
runtime.exec
quartz-graphics
mylyn
chronoforms
random-seed
android-screen-support
ember-app-kit
anonymous-methods
dsn
nsmanagedobject
netdna-api
whoosh
mercurial-server
gnu-prolog
mysql-error-1005
ext3
firefox-5
xetex
thread-local-storage
spec#
3gp

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App