game-maker


game maker two player same screen move between rooms issue


I am currently learning game maker. I have made a small simple 2d top down hack and slash game from different tutorials online. I have added a second player using 360 controller and started creating new levels. The issue I am having is moving both players to a new room. I have collision on an object door that checks if a player touches the door then moves them to a new room. However when the player moves rooms the other player does not move with them to the same location.
///door object collision
if (room_exists (other.new_room))
{
room_goto(other.new_room);
x = other.newx;
y = other.newy;
}
///creation code on the door in the map
new_room = rm2;
newx = 64;
newy = 34;
is there a way to assign obj_player2 to the new room as well using the same location?
I assume both player objects are persistent and this is the player 1's collision event.
You are only assigning the new position to player 1, simply do the same for player 2.
if (room_exists (other.new_room))
{
x = other.newx;
y = other.newy;
obj_player2.x = other.newx;
obj_player2.y = other.newy;
}

Related Links

Game Maker window and room are rectangle but room is a square in testing
Game Maker bounce code not woking
game maker two player same screen move between rooms issue
How to make water pour in GML?
How to make text change in game maker?
how to create a shooting bullet using gamemakers built in physics
game maker part of object collides while other doesn't
Set GameMaker to Use Windowed Area
game maker bouncing collision does not work all the time
Game maker - Image index will not change
Can someone see what's wrong in this code in GML?
how to stop change instance when collision stops in game maker studio?
Game Maker Turn On/Off Sound Effects
How to pour liquid in game maker?
is there a way to make a flashlight that cannot go through solid objects in game maker
call ds_list from diffrent object error

Categories

HOME
hpoo
oracle
webview
lambda
generics
automapper
plpgsql
filesize
google-webmaster-tools
gallery
azure-mobile-services
tweepy
tfs2010
azure-logic-apps
hspi
bellman-ford
watch-os-3
pm2
cuba-platform
squirrel-sql
rest-assured
c#-7.0
pickle
cloudsim
spam
bazaar
pdf.js
jstree
web-push
introspection
msdeploy
ninject
bitbake
netbios
nsmutablearray
kendo-listview
apptentive
autoencoder
pdfminer
installanywhere
unification
klee
icepdf
flipkart
google-prediction
virtual-memory
git-tfs
asihttprequest
realstudio
section508
return-type
knockout-2.0
renderman
sigsegv
watir-webdriver
exc-bad-access
pen
dtd
emacs25
scheduledexecutorservice
e
bilinear-interpolation
zynq
msbuild-4.0
qtcpsocket
android-syncadapter
jeditable
gwt-syncproxy
vimperator
teensy
deeplink
perceptron
ibm-was
bjam
extend
postal-code
supersocket.net
whitespace-language
jcheckbox
cakephp-2.2
configurable-product
wicket-1.5
object-code
oracle-adf-mobile
forio-contour
commenting
ivalueconverter
mp4parser
django-facebook
tnt4j
apportable
rikulo
mongo-jackson-mapper
ui-design
donut-chart
itunes-sdk
daap
struts2-json-plugin
arrow
wiktionary
memory-pool
django-apps
vows
office-automation
gaelyk
browser-based
html-components
google-translator-toolkit
processors
main-method
downcasting
server-load

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