Newgrounds.com — Everything, By Everyone.

Checking login status…

USERNAME:

PASSWORD:

Logging in…

Logged in as:
.
Logging out…
Inbox My Account Log Out


Forum Topic: Help me... for I am an idiot

(72 views • 2 replies)

This topic is 1 page long.

<< < > >>
Crying

TaroNuke

Reply To Post Reply & Quote

Posted at: 6/6/08 12:53 PM

TaroNuke LIGHT LEVEL 15

Sign-Up: 10/05/05

Posts: 109

OK.

http://spamtheweb.com/ul/upload/060608/6 4161_SuperNukeBrosMelee.php

I am using _root._x, _root._y, _root._xscale and _root._yscale for zoom and camera position.

The WHITE box, I would like to put HUD and stuff in, but I cannot get it to plaster to the screen.
I have tried A LOT of things, each with no success. I would just like it so that the white box stays
in one spot on screen before I put things in it...

code in frame:

scalezors = 80;
topcb = 50;
leftcb = 0;
rightcb = 550;
bottomcb = 250;
topdb = -400;
leftdb = -500;
rightdb = 1000;
bottomdb = 800;
onEnterFrame = function () {

if (_root.pl1._x>leftcb && _root.pl1._x<rightcb) {
_x = Math.round(-(1.25*scalezors/100)*_root.p l1._x+((275+(275+550)/2)/2));
}
if (Math.round((0.3*scalezors/100)*_root.pl 1._y+(100))>topcb && Math.round((0.3*scalezors/100)*_root.pl1 ._y+(100))<bottomcb) {
_y = Math.round(-(0.3*scalezors/100)*_root.pl 1._y+(100));
}
_xscale = scalezors;
_yscale = scalezors;
_root.hud._x = -_x+275;
_root.hud._y = -_y+200;
};

I am trying to get _root.hud to stay in one spot on the screen. Why is it so hard?


None

CaiWengi

Reply To Post Reply & Quote

Posted at: 6/6/08 01:12 PM

CaiWengi EVIL LEVEL 05

Sign-Up: 09/17/04

Posts: 1,003

I know its going to be complicated for movement like that, but when I had this problem I used the movment code from the character on the HUD. Its simple for a top down game, but something like this it will take modification. I guess you could get the _x co-ordinates working fairly well this way, but for _y its obviously going to be harder with floor and platforms involved.

Anyway you probably thought of this ages ago, but just in case.

Good luck, and the movment is looking reallly nice and smooth atm :]

O RLY? SRSLY? NO WAI? "chill out chiWengi!"

BBS Signature

None

TaroNuke

Reply To Post Reply & Quote

Posted at: 6/6/08 02:08 PM

TaroNuke LIGHT LEVEL 15

Sign-Up: 10/05/05

Posts: 109

SOLVED.

_root.hud._x = (-_x*(1/(scalezors/100)));
_root.hud._y = (-_y*(1/(scalezors/100)));
_root.hud._xscale = 1/(scalezors/100^2);
_root.hud._yscale = 1/(scalezors/100^2);

Fixed everything.


All times are Eastern Daylight Time (GMT -4) | Current Time: 02:42 AM

<< Back

This topic is 1 page long.

<< < > >>
You need a Grounds Gold Account to post on the NG BBS! If you don't have one, click here to sign up now! It's fast, free, and easy — and opens up tons of great NG features!