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

Xna Game referencing Game in update
XNA game studio simple sprite animation
XNA phase management
How to check BoundingSphere for one ModelBone?
MonoGame: Some VertexColorPosition dissappear while drawing user primitives(DrawUserPrimitives)
Testing XNA 4.0 games On the XBOX 360 without paying $100 [duplicate]
Detecting clicks in a non-rectangular shape
What's a good way to optimise rendering a 2D tile game in XNA?
How to make 3D racing game with XNA? [closed]
How to correctly accelerate a rotated 3d model in XNA?
What's the difference between world and view for purpose of camera?
Vertexbuffer Getdata VertexPositionNormalTexture
Converting from 3.1 to 4.0… gamestates
XNA large coordinates and float precision
Trying to make Gaussian Blur stronger/blurrier - XNA 4.0 HLSL
XNA, EmguCV and perfomance issue with webcam

Categories

HOME
osgi
heroku
hp-exstream
raspberry-pi
adb
amortized-analysis
sqlite3
dxl
baqend
paradox
elasticsearch-hadoop
iggrid
facebook-php-sdk
modx-revolution
quickbooks
visual-studio-2005
libtiff
foselasticabundle
saxon
facebook-page
text-rendering
lldb
plunker
xlsxwriter
realex-payments-api
zurb-foundation-6
crosstab
dynamic-featured-image
minitab
neo4j-spatial
wtx
google-cloud-endpoints-v2
functor
noraui
framemaker
stringtemplate
xmlreader
mozilla
io-redirection
dartium
serve
c11
xenforo
leading-zero
broadcastreceiver
sql-server-agent
slick-3.0
long-polling
fault
network-flow
react-scripts
pubmed
yii2-extension
flutterwave
lync-client-sdk
redundancy
word-vba-mac
parallel-data-warehouse
instant
httplistener
pcf
py2app
etsy
jwplayer7
revolution-r
xpath-1.0
wapiti
uid
pervasive-sql
thredds
browser-bugs
sframe
splash
c++03
sorl-thumbnail
gwidgets
gui-test-framework
relocation
id3v2
websocket4net
starcluster
dml
kgdb
concurrent-collections
flexmojos
ccss
flash-builder4.5
anonymous-methods
libstdc++
labwindows
gnustep
visitor-statistic
w3wp.exe
gamequery
gin
filtered-index
vc90
brewmp
libs
backcolor
temporal-database
yagni

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App