view.x=view.x?

Game Editor comments and discussion.

view.x=view.x?

Postby ckn087 » Thu Oct 13, 2016 2:31 am

I'm having serious issues getting my view to move in a certain part of my game. Very first part of the game(my intro) works fine. After a certain animation finishes on my intro, I have it set to: create timer: loadmenu, 3000 ms, 1 times on view. Then on view I have Timer: loadmenu, 3000 ms, 1 times, script editor: view.x=view.x =+320; After it takes me to my menu, I click the start button which takes me to wave 1 with background screen. After this point is when things get weird. I have it set to: When enemy actor is destroyed it creates small timer(just so it wont jump over to wave 2 so fast). nextwave, 2500 ms, 1 times on view. On view I have Timer: nextwave, 2000 ms, 1 times: view.x=view.x =+320; but instead of moving my view to the right like it did the first 2 times, it brings my finished animation intro screen to the right and covers part of the screen!!! Please help!!!
ckn087
 
Posts: 30
Joined: Thu Jan 14, 2010 12:29 pm
Location: U.S.A
Score: 1 Give a positive score

Re: view.x=view.x?

Postby lcl » Thu Oct 13, 2016 7:38 am

You seem to have mixed a few things. When incrementing a value, there is two ways you can do it:
Code: Select all
view.x = view.x + 320;
or
Code: Select all
view.x += 320;

Both of these codes do the exact same thing, increment view's x by 320. You were trying to combine both of these methods (though you had the + and = in wrong order) and what you ended up with was a code that didn't do what you thought it should.

I hope this helps :)
User avatar
lcl
 
Posts: 2339
Joined: Thu Mar 25, 2010 5:55 pm
Location: Finland
Score: 276 Give a positive score

Re: view.x=view.x?

Postby Zivouhr » Tue Nov 15, 2016 3:31 am

While X, Y to align the view is good in general and good advice, I had some strange results with it once my first game got gigantic in scale. I could be wrong about this, but: :idea:
In my 1st 2014 game, Tomb of Twelve, I was using the xy coordinates to align the view and try to get it to quickly move to a distant location when the player died, but for some reason, it kept going to the wrong spot and messing up my game.
The player and view weren't appearing exactly where they needed to. I tried a number of combinations, and the coordinates were exactly on target, but then I used the same coordinates with the "Move To" command. No longer any consistency problems at all, and the game was saved along with hours of grief trying to get the other method to work. Move To is the way I set things with all my games and haven't had any problems since.

Game Editor, the bigger the game gets, does run into some issues with older coding inputs already stored in the game, not responding to updates to that code, along with crashes due to "not enough memory" while in editor mode, and a few other odd glitches now and then that could use ironing out.
City of Rott Game created on Game Editor http://cityofrott.wordpress.com/
User avatar
Zivouhr
 
Posts: 549
Joined: Sat May 17, 2014 2:12 pm
Score: 59 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest