Powered by Invision Power Board

 
    Reply to this topicStart new topicStart Poll

> A Code
United States
Mario Master1
Posted: Oct 25 2009, 09:21 AM
Quote Post


Skid, run, repeat.


Group Icon
Group: Members
Posts: 143
Member No.: 5816
Joined: 2-November 08

Status: (0d) [--]


I'm making a game using ultramario's wario land engine, and I'm trying to make it so i can jump on the enemy and it'll die. I've actually made the code for this, but I forgot it, and the old game isn't on my computer. So if you have the code, thanks.


--------------------
user posted image

user posted imageRef1(Normal)Ref2(Mario Ref)Ref3(By Torcher)user posted image

PMEmail PosterUsers WebsiteAOL
Top
United Kingdom
Thingy
Posted: Oct 25 2009, 09:58 AM
Quote Post


So long MFGG 2.0~
[*][*][*][*]

Group Icon
Group: Members
Posts: 1824
Member No.: 4642
Joined: 30-October 07

Status: (0d) [--]


on collison with enemy
if vspeed > 0
[make enemy die]
else
[whatever your 'hurt' code is]

(pseudocode)


--------------------
user posted image
Old ref, Current ref
Click to see the rest. (opens sig on top post)

user posted image
Hey, MFGG 3.0, it's me from the past.
PMEmail PosterMSN
Top
Germany
TheSuperyoshi
Posted: Oct 25 2009, 10:08 AM
Quote Post


Play my game. No better idea what to write :P
[*]

Group Icon
Group: Members
Posts: 125
Member No.: 6377
Joined: 8-July 09

Status: (0d) [--]


Thingy's right, but it also kills the enemy when you hit it from the side and you're falling. You should also check if the player is over the enemy...

CODE
if (player.vspeed > 0) {
if (player.x+player.sprite_height < this.x+3) {
 //kill object
} else {
 //hurt Player
}
} else {
//hurt Player
}


--------------------

user posted image ----- user posted image
I was drawn by: Me (aka. Ref) - fiDumppi
I drew: Segatendo (in Progress) - mirror
user posted image

PMEmail PosterUsers WebsiteICQMSN
Top
United States
Mario Master1
Posted: Oct 25 2009, 10:09 AM
Quote Post


Skid, run, repeat.


Group Icon
Group: Members
Posts: 143
Member No.: 5816
Joined: 2-November 08

Status: (0d) [--]


QUOTE (Thingy @ Oct 25 2009, 09:58 AM)
on collison with enemy
if vspeed > 0
[make enemy die]
else
[whatever your 'hurt' code is]

(pseudocode)

thanks! but one more thing, i wanna make it so he bounces off, not go right thru, and i tried making the vertical speed -6, but all it did was hurt me, and kill the enemy. if it ok, can i have a bouncing code to?


--------------------
user posted image

user posted imageRef1(Normal)Ref2(Mario Ref)Ref3(By Torcher)user posted image

PMEmail PosterUsers WebsiteAOL
Top
Germany
TheSuperyoshi
Posted: Oct 25 2009, 10:18 AM
Quote Post


Play my game. No better idea what to write :P
[*]

Group Icon
Group: Members
Posts: 125
Member No.: 6377
Joined: 8-July 09

Status: (0d) [--]


In Enemy Object:

CODE
if (player.vspeed > 0) {
if (player.x+player.sprite_height < x+3) {
 //kill object example code
 instance_change(enemy_dead,true)
 player.vspeed = -6
} else {
 //hurt Player
}
} else {
//hurt Player
}


Never used Ultramario's Engine, so meh.


--------------------

user posted image ----- user posted image
I was drawn by: Me (aka. Ref) - fiDumppi
I drew: Segatendo (in Progress) - mirror
user posted image

PMEmail PosterUsers WebsiteICQMSN
Top
United States
Mario Master1
Posted: Oct 25 2009, 10:30 AM
Quote Post


Skid, run, repeat.


Group Icon
Group: Members
Posts: 143
Member No.: 5816
Joined: 2-November 08

Status: (0d) [--]


QUOTE (TheSuperyoshi @ Oct 25 2009, 10:18 AM)
In Enemy Object:

CODE
if (player.vspeed > 0) {
if (player.x+player.sprite_height < x+3) {
 //kill object example code
 instance_change(enemy_dead,true)
 player.vspeed = -6
} else {
 //hurt Player
}
} else {
//hurt Player
}


Never used Ultramario's Engine, so meh.

umm, can you convert that into this:user posted image

cuz thats what the engine is using


--------------------
user posted image

user posted imageRef1(Normal)Ref2(Mario Ref)Ref3(By Torcher)user posted image

PMEmail PosterUsers WebsiteAOL
Top
India
Char
Posted: Oct 25 2009, 11:49 AM
Quote Post


fad was bad
[M][*][*]

Group Icon
Group: Admins
Posts: 2123
Member No.: 2856
Joined: 25-October 06

Status: (0d) [--]


If vspeed is larger than 0
^
If (x+sprite_height) is less than (x+3)
^
Change other instance into megamoledead
Set variable vspeed to -6
v
Else
^
If vulnerable is equal to 1
Change instance into WAH
v
v
Else
^
If vulnerable is equal to 1
Change instance into WAH
v

probably wrong.. i haven't touched D&D in years


--------------------
aa this broke


Make your own | If a level is breaking the rules, note the ID and PM me.
Reference (thanks Frogjester!)
PMEmail PosterUsers WebsiteAOLYahooMSN
Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

  Topic Options Topic Options Reply to this topicStart new topicStart Poll

 




[ Script Execution time: 0.0643 ]   [ 13 queries used ]   [ GZIP Enabled ]   [ Server Load: 2.81 ]